admin管理员组

文章数量:1297037

I have an HTML input element for my datepicker... pretty normal

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

And a pretty normal setup for allowing the Month / Year changes

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

But the Month dropdown shows names like "Jan" instead of "1" or "01"

How can I change the dropdown values to be the numerical representation?

I have an HTML input element for my datepicker... pretty normal

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

And a pretty normal setup for allowing the Month / Year changes

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

But the Month dropdown shows names like "Jan" instead of "1" or "01"

How can I change the dropdown values to be the numerical representation?

Share Improve this question asked Nov 29, 2012 at 17:17 adamadam 2,9708 gold badges56 silver badges89 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

Check datepicker options here: http://api.jqueryui./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"]
});

This might be a solution.

本文标签: javascriptjquery DatePickernumeric month dropdownStack Overflow