jpemberthy
jpemberthy

Reputation: 7533

How can I exclude seconds from the datetime_select helper?

How can I suppress the generation of the seconds tag when using the datetime_select helper?

I tried using the option :include_seconds => false (used in the time_select helper) but It doesn't work.

Upvotes: 3

Views: 1820

Answers (1)

Bill Turner
Bill Turner

Reputation: 3697

You can override what's shown with :order, such as:

<%= f.datetime_select :fieldname, :order => [:month, :day, :year, :hour, :minute] %>

Possible options for :order are [:month, :day, :year, :hour, :minute, :second]

Upvotes: 1

Related Questions