How can I get Rails to interpret a text field as a datetime

Posted by doctororange on Stack Overflow See other posts from Stack Overflow or by doctororange
Published on 2010-04-24T04:09:05Z Indexed on 2010/04/24 4:13 UTC
Read the original article Hit count: 315

Filed under:
|
|

My database has a datetime field, and I want to be able to create new entries. Obviously the Rails datetime_select helper isn't the most user friendly thing to have in your form.

I'd rather have a text field for the datetime (or one for the date, and one for the time) and interpret the inputs like PHP strtotime can.

I might just be searching the wrong keywords. Surely this has been discussed in great depth somewhere.

Thanks

:0)

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about datetime