1

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?

1 Answer 1

10

Check datepicker options here: 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"]
});

This might be a solution.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you!! I would upvote this 5x if possible. Any idea when this feature was added? All of my google-searches turned up as "this is not possible" and even one link from the date-picker project that said it would not be implemented.
No idea, too bad that there are no dates of revision in the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.