excid3 / combined_time_select

A Rails time_select like Google Calendar with combined hour and minute time_select
MIT License
61 stars 22 forks source link

Disable Option #12

Closed MarlabsKochi closed 7 years ago

MarlabsKochi commented 8 years ago

Hi @excid3 Is there is any option available for disabling some time slots ?

For Example, I am using 10AM till 2PM with 30 interval, we can 10,10.30,11,11.30, 12, 12.30, 1, 1.30, 2

I want to disable only 11.30. Is that possible using your gem ?

excid3 commented 8 years ago

@MarlabsKochi Not currently, and not sure I have plans to do that or not, but if you override this method, you can modify this loop in order to skip the times you don't want included. https://github.com/excid3/combined_time_select/blob/master/lib/combined_time_select.rb#L54

I would just implement this in an initializer or something and that should do the trick.