My datepicker is showing the default format mm/dd/yy even after changing the format to yy-mm-dd
This is my script.js
$(function(){
$( "#date" ).datepicker( "option", "dateFormat", "yy-mm-dd");
$( "#date" ).datepicker();
})
Please help.
My datepicker is showing the default format mm/dd/yy even after changing the format to yy-mm-dd
This is my script.js
$(function(){
$( "#date" ).datepicker( "option", "dateFormat", "yy-mm-dd");
$( "#date" ).datepicker();
})
Please help.
Try this one:
$( "#date" ).datepicker({dateFormat: 'yy-mm-dd'});
You are calling the datepicker twice. The second time without any options, so it is called with its default options and seems to override the first one
Here's a fiddle working: http://jsfiddle.net/qG4PC/