zpaulovics / datetimepicker-rails

A date and time picker for Twitter Bootstrap in Rails using Simple Form
MIT License
174 stars 80 forks source link

Getting i18n return object error #76

Closed ayounis90 closed 8 years ago

ayounis90 commented 8 years ago

I18n::ArgumentError in Reservations#edit Object must be a Date, DateTime or Time object. "01/28/2016" given.

This is the error I get when I go to edit a form that was previously submitted in my application. I've been trying to search for the problem online but have not come across anything that's solved the issue. I thought it might be better to post here before posting on Stackoverflow.

thecookieorg commented 8 years ago

Has this been solved yet? I have the same issue.

ayounis90 commented 8 years ago

yes, so in the migration table you should have

t.date :tripDate t.time :tripTime

you can look at other examples too, this is just the way i'm doing it.

thecookieorg commented 8 years ago

Yes, I was storing the values as a string instead of a date type..... Awesome!

ayounis90 commented 8 years ago

I did not know about this either since this was the first time using anything related to DateTime... good luck with the rest of your project.