how to change dateformat of jquery Datepicker

一曲冷凌霜 提交于 2019-12-11 03:32:50

问题


i'm using the jquery 1.5.1 and 1.8.11 jQueryUI and i'm getting a very strange problem. i've tried a lot of things and the behaviour seems to be just the same.

what happens if that i whant to get my date addoring the "yy-mm-dd" format according the documentation. but, as all the examples i use the tipical code (below) and when i start writing the date on the textbox, i cannot type some thing like '2011-03-22' because when i type the first 2(of day) the widget assumes automatically the 02 value.

$("#txtDTPicker").datepicker({
    altField: "#lblPkr",
    altFormat: 'yy-mm-dd',
    dateFormat: 'yy-mm-dd',
    showOtherMonths: true,
    selectOtherMonths: true,
    showOn: "button",
    buttonImage: "/images/calendar_icon.gif",
    buttonImageOnly: true
});

Does anyone have an idea how to solve this? what i whant is just write my date on the format 'yy-mm-dd' without the datepicker decide for me what i should have on the textbox?

来源:https://stackoverflow.com/questions/5394964/how-to-change-dateformat-of-jquery-datepicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!