dimanche 11 septembre 2016

Rails DateTime format can't be corrected

I have two columns in my app that are of type DateTime.

When editing an entry in the application, I am pasting

12/09/16 10:39

But when it goes to the show page, it shows:

16/09/12 10:39

I have entered:

Time::DATE_FORMATS[:default] = "%d/%m/%y %H:%M"

In 'application.rb', 'environment.rb', created a file 'time_format.rb' in the 'initializers' folder, 'ticket.rb' in models folder. Any other suggestions as to where I can correct this?

When going to edit the DateTime value while editing the entry, it shows as

0012-09-16 00:59:08.000000 

in the text_field for some reason.

Thanks.

Aucun commentaire:

Enregistrer un commentaire