I have a requirement to display duration as HH:MM in Rails as two select boxes one for hours and other for minutes. Restrict the hours to max of 4:00. duration (column type:integer) is stored as minutes in database. And I am using formtastic.
如果我不时地投入,我就能够随着HHH:MM的下降而获得产出格式。
"<%= f.input :duration, :label => Duration , :as=>:time, :minute_step => 15, :hint=>"Measured in hours", :end => 10 %>"
我如何限制甄选所显示的时间(只有1、02、03、04小时在下降数小时时)?
请允许我知道,是否为铁路/铁路规定了任何选择。 或者,处理这种情形的方法是否更好?