[英]datepicker jquery ui change date format to text
For picking the dates in a form I am using the JQuery UI datepicker. 为了选择表单中的日期,我使用了JQuery UI datepicker。 I know the option for setting another dateFormat
like so $( ".selector" ).datepicker({dateFormat: "dd-mm-yy"});
我知道设置另一个dateFormat
的选项,例如$( ".selector" ).datepicker({dateFormat: "dd-mm-yy"});
. 。 Is it possible to change this to text, so if I pick the second of March (this will get me 02-03-2017 with the option above) it will give me 2 March 2017? 是否可以将其更改为文本,所以如果我选择三月的第二天(使用上述选项,这将使我获得02-03-2017),它将给我2017年3月2日? I have looked into the dateFormat
option but I can't get it right.. Thanks in advance 我已经研究了dateFormat
选项,但我做对了。
Yes, you can do it with: 是的,您可以执行以下操作:
$("#datepicker").datepicker().datepicker("option", "dateFormat", "d MM yy");
or 要么
$("#datepicker").datepicker({ "dateFormat": "d MM yy" });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.