Hi i am using an date picker on selecting a date the date开发者_如何学Go is displayed in this format month/date/year .... How to convert the date to this format year-month-date in date picker js itself
Date.firstDayOfWeek = 0; Date.format = 'yyyy-mm-dd'; $(function() { $('.date-pick').datePicker() });
This will apply the date format to all datepickers that are created after:
$.datepicker.setDefaults({
dateFormat: 'dd.mm.yy'
});
Or to apply to a specific datepicker:
$('#selector').datepicker({
dateFormat: 'dd.mm.yy'
});
精彩评论