开发者

how to change the date format in jquery date picker?

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'
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜