Datepicker format appeared incorrectly

1841 views javascript
8

Here is my datepicker view code:

 <input type="text" class="form-control datepicker" id="Date" name="Date"  required parsley-maxlength="6" placeholder="Date" />   

My Script is:

 $(".datepicker" ).datepicker({ dateFormat: 'dd-mm-yy' });   

But when using date picker,Date shown in mm/dd/yyyy format.How to change it to dd/mm/yyyy format?

answered question

2 Answers

3

<input type="text" class="form-control datepicker" id="Date" name="Date" data-date-format="dd/mm/yyyy" required parsley-maxlength="6" placeholder="Date" /> 

Add attribute data-date-format="dd/mm/yyyy" to your datepicker view

posted this

Have an answer?

JD

Please login first before posting an answer.