-3

I noticed in JQuery UI 1.10.3 it would update the datepicker if the user types 1/2/11 or 1/2/2011 (as seen here), but in the more updated versions it seems to only update when a full year is typed in if the default format is set.

I've gotten code so far that will validate if a date is valid using a timer on keyDown, but I can't seem to refresh the datepicker.

Is there a way to refresh/regenerate the datepicker? I've tired doing datepicker('refresh') but that doesn't seem to update to the date that's been typed. Or is there a setting I am missing to allow a user to type 1/1/11 or 1/1/2011 and get an updated datepicker?

1 Answer 1

0
$( "#datepicker" ).datepicker( "option", "dateFormat", format );

Example of formats: "mm/dd/yy"| "yy-mm-dd"| "d M, y"| "d MM, y"| "DD, d MM, yy"

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

3 Comments

Can you set format to an array of options? I thought you could only set it to one format and then update it as needed?
I just provided the different kind of formats as examples. If you want the user to select a format, you can provide the list of formats in a drop down and have the user select it and you shall later apply the selected to the date format option.
Ok. I was trying to determine the date format based on what the user typed in, as it seemed to be doing in in 10.1.3. The date picker updated regardless if the user typed in 11/4/13 or 11/4/2013, if you look at the jFiddlr in the example I provided. I was wondering where the functionality went in the more recent jQuery UI or if their is a setting I need to change. If not what would be the best way to update the datepicker once I determined the date is valid?

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.