In my app, users should only be able to select times between 10am and 12pm, and then 4pm and 6pm. Basically I want my 'hours' drop-down menu to only list "10am, 11am, 12pm" and "4pm, 5pm, 6pm". Is this possible?
Asked
Active
Viewed 890 times
1 Answers
3
<%= f.time_select :time,
{ampm: true,
ignore_date: true,
start_hour: 10,
end_hour: 18,
discard_minute: true,
prompt: true,
prompt: { hour: "Choose hr" }
} %>
can be a start? may be you can write a script to disable the other hours or you use JavaScript to genereate the html options for you?

KcUS_unico
- 513
- 3
- 9