1

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?

0

1 Answer 1

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.