amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.02k forks source link

Disable time - when not found, just rounds up #1157

Closed edwardj728 closed 5 years ago

edwardj728 commented 5 years ago

Hi all, please take a look at this demo code link: https://codepen.io/anon/pen/QPaJoE

As you can see, the interval is 15 minutes. I want to disable 1:20 am. Since 1:20 am is not a valid/found time, it automatically disables the next time on there, which is 1:30 am.

Does anyone have a solution to this? If the time is not found, then don't disable anything for that time.

DanielRuf commented 5 years ago

Hi,

Since 1:20 am is not a valid/found time, it automatically disables the next time on there, which is 1:30 am.

This looks correct to me as you use the interval of 15 minutes.

And the next valid time is disabled. See https://github.com/amsul/pickadate.js/blob/master/lib/picker.time.js#L419-L420

edwardj728 commented 5 years ago

Hi,

Since 1:20 am is not a valid/found time, it automatically disables the next time on there, which is 1:30 am.

This looks correct to me as you use the interval of 15 minutes.

And the next valid time is disabled. See https://github.com/amsul/pickadate.js/blob/master/lib/picker.time.js#L419-L420

It would be the same with # of minutes... Is there any way to disable it so that if the time is not found, it doesn't select the next one?

DanielRuf commented 5 years ago

No, see the marked lines. It searches for the next available time.