开发者

how to change the date format in jquery date picker?

开发者 https://www.devze.com 2023-01-01 12:54 出处:网络
Hi i am using an date picker on selecting a date the date开发者_如何学Go is displayed in this format

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

精彩评论

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

关注公众号