Datepicker dateFormat 未正确加载
我正在尝试加载 jQuery UI 日期选择器字段并显示完整日期。所以我执行以下操作:
$("#reminderDate").datepicker({ dateFormat: "DD, d MM, yy" });
但是,当页面首次加载时,日期以默认格式 mm/dd/yyy 显示,但在我选择另一个日期后,它会更改为完整格式。我缺少什么?
I am trying to load my jQuery UI datepicker field with the FULL date shown. So I do the following:
$("#reminderDate").datepicker({ dateFormat: "DD, d MM, yy" });
However, when the page first loads, the the date appears in default format mm/dd/yyy, but after I select another date it changes to full format. What am i missing?
无论您使用哪种服务器端语言来输出该
元素的值,都需要格式化日期,以便它与您在日期选择器中使用的格式匹配。日期选择器不会自动格式化最初针对
元素设置的值。
Whatever server side language you're using to output the value of that
<input>
element needs to format the date so that it matches the format you're using in the date picker. The datepicker won't auto-format the value that's originally set against the<input>
element.