On 11 Jul 2008, at 10:51, Jolé wrote:
>
> Hi!
>
> I created a table like this:
>
> create_table :work_items do |t|
> t.date :execution_date
> t.string :section
> t.integer :member_id
> t.time :duration
> t.text :description
>
> t.timestamps
> end
>
> I need the duration field to enter something like HH:MM. Just the time
> without a date.
>
> When I enter it, everything seems fine... But when I return to the
> edit view I see the time formatted like 2000-01-01 10:23:00...
>
> When I create a validate method in the model to check on the input, I
> allways get 2000-01-01 10:23:00, weird because I only entered 10:23...
>
Ruby doesn''t have a pure time of day class. Just don''t display
the non
time of day bit. (eg use time_select instead of datetime_select for
editing and so on)
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---