rails change date format before saving to mysql DB -
I have a datepay that I want to display in MM / DD / YYYY. Although I am using a MySQL DB which wants YYYY-MM-DD as it saves it now, but the days and months are reversed.
I have an analytics now, date_time_formats.rb who has:
Date: DATE_FORMATS [date: default] = '% m /% d /% y Even in my datepicker jscript, I have the correct format that I want to display: $ (this). Datacar ({"Format": "mm / day / year", "Weekstart ": 0," Autoclose ": True," Start ": New Date ()}); I have tried to do things like this:
date.stream (parameter [: location], "% d /% m /% Y ") But I get a hashishindifiable Aces error.
How can I reproduce the date in the parameter hash before being told an example of the model? This reason seems to be rejected due to the model that this date will be invalid (April 4, 2013 is OK, but not April 20, 2013 because 20th month is not there). I am doing a big job, so can be a trainer to do the job, but I am wrong but it works how it works. Thanks!
Try the American_date gem located here:
Comments
Post a Comment