1

我的日期选择器有一个 HTML 输入元素……很正常

<input type="text" id="from_date">

以及允许月份/年份更改的非常正常的设置

$('#from_date').datepicker({
    dateFormat: "mm/yy",
    changeMonth: true,
    changeYear: true
});

但月份下拉菜单显示的名称如“Jan”而不是“1”或“01”

如何将下拉值更改为数字表示?

4

1 回答 1

10

在此处检查日期选择器选项:http: //api.jqueryui.com/datepicker/

$('#from_date').datepicker({
    dateFormat: "mm/yy",
    changeMonth: true,
    changeYear: true,
    monthNames: ["1","2","3","4","5","6","7","8","9","10","11","12"],
    monthNamesShort: ["1","2","3","4","5","6","7","8","9","10","11","12"]
});

这可能是一个解决方案。

于 2012-11-29T17:35:03.330 回答