Bad*_*sie 6 jquery jquery-ui datepicker jquery-ui-datepicker
jQuery datepicker有一个用于更改月份的选择框,但它没有显示完整的月份名称(但在其他月份确实如此),这真让我烦恼.
截图: http ://i.imgur.com/Pdkq0.png
有没有办法自定义datepicker以显示完整的月份名称而无需修改源代码?
小智 12
也许有点晚了,但此刻我遇到了同样的问题而且很容易修复.在调用datepicker函数之前获取monthnames数组,将它们放入一个新变量并通过调用该变量来更改短名称:
var fullmonth_array = $.datepicker.regional['nl'].monthNames; // change 'nl' to your own language of course
$('input[name="date-of-birth"]').datepicker(
{
changeYear : true,
changeMonth : true,
yearRange : "-85:-18",
maxDate : "-18Y",
minDate : "-85Y",
monthNamesShort : fullmonth_array
// other stuff
}
Run Code Online (Sandbox Code Playgroud)
更好的解决方案是使用monthNames您的语言环境对象.
// jQuery UI datepicker
$("#datepicker").datepicker({
monthNamesShort: $.datepicker.regional["en"].monthNames
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21616 次 |
| 最近记录: |