javascript - Setting bootstrap date format to yyyy-mm-dd in laravel blade
in my laravel application I'm using bootstrap 4.
There is one of my forms I have a text field for picj the birthday
{!! Form::date('date_of_birth', null, array('placeholder' => __('texts.Date of birth'),'class' => 'form-control txt_txt','id'=>'from-datepicker')) !!}
This gives me date in the format of mm/dd/yyyy
But I need my date to be yyyy-mm-dd
I even tried using
<script>
jQuery("#from-datepicker").datepicker({format: 'yyyy-mm-dd'});
</script>
but this also gave me a JavaScript error saying datepicker is not a function
How can I set my date picker format to yyyy-mm-dd
Answer
Solution:
Funtion name maybe different try this..! .datetimepicker()
$('#from-datepicker').datetimepicker(
{format: 'yyyy-mm-dd'}
);
Source