Closed donv closed 9 years ago
I know is late for an answer, but might be useful for others.
The default date format in Rails and how they are appearing in the input should match in order to make it work when saving the field. To define the default date format in your Rails app, add an initialiser into config/ with:
Date::DATE_FORMATS[:default] = "%m-%d-%Y" Time::DATE_FORMATS[:default] = "%m-%d-%Y %H:%M"
Then, you should use the datepicker options to set them in the same way, using the dateFormat parameter:
http://api.jqueryui.com/datepicker/#option-dateFormat
So, answering your question, use the options in the link bellow for setting the format as you wish.
I'll add clarifications into the README file. Thanks!
We have stopped using this gem, so this issue is obsolete.
It would be very handy to have an example of this. The statement in the README regarding this is a bit confusing:
Can you explain how an existing date can be formatted so it appears in the datepicker input, for example, as "June 26, 2012"?