I'm using jQuery in a Rails app to show the start time and end time, which come from helper (I'm not using Datepicker).
In my form:
.field
= f.label :start_time
= f.select :start_time, options_for_select( [""] + start_time, "#{f.object.start_time.strip}")
.span#end_time
.field
= f.label :end_time
= f.select :end_time, options_for_select( [""] + end_time, "#{f.object.end_time.strip}")
The time list comes from helper (i.e. start_time
and end_time
). How can I validate the time so that I can only select an end_time
that is greater than the start_time
?