如何更改jquery Datepicker的dateformat [英] how to change dateformat of jquery Datepicker
问题描述
如果我不想让我的日期加上yy-mm- dd格式。但是,正如所有的例子,我使用的代码(下面),当我开始在文本框上写日期时,我不能输入像2011-03-22这样的东西,因为当我键入前2个(一天)
$(#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
});
有没有人有一个想法如何解决这个问题?我只是在格式'yy-mm-dd'上写我的日期,而没有datepicker会决定我在文本框上应该有什么?
$(.selector).datepicker({dateFormat:'yy-mm-dd'});
http://docs.jquery.com/UI/Datepicker#option-date格式
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?
$( ".selector" ).datepicker({ dateFormat: 'yy-mm-dd' });
http://docs.jquery.com/UI/Datepicker#option-dateFormat
这篇关于如何更改jquery Datepicker的dateformat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!