ruby on rails - Formtastic Time fields to read as HH::MIN(00 & 30) instead of two selects? -
I am looking for a way to override the pharmastic plug-in in the train so that time is a single drop-half With minutes of representation in hour increments below
1:00 am, 1:30 am, 2:00 am, etc. before?
Appreciate it with any help.
I think you can give this one a try. It's really simple and will provide you with a drop to get the desired time.
For example, to prepare a list of time in the half-hour increase, you should do something like this:
$ ("time"). TimePicker ({show24Hours: incorrect, step: 30});
Where is it. Time is the square of your text_field:
<% = your_time_form.text_field: time,: class => "Time" ,: value = & gt; Time% & gt;
Of course, then in Assistant / Controller you will need to manipulate this value to create the desired object (maybe a datetime instance).
Comments
Post a Comment