jonthornton / Datepair.js

A javascript plugin for intelligently selecting date and time ranges, inspired by Google Calendar.
https://www.jonthornton.com/Datepair.js
360 stars 85 forks source link

rangeIncomplete fires after clearing BOTH time pickers #96

Open jkallay1 opened 7 years ago

jkallay1 commented 7 years ago

Starting with a time set in both time pickers, the event fires after clearing one and then again after clearing the other. This is semantically incorrect, as having an entirely empty range is different from having one with only one value.

jonthornton commented 7 years ago

Can you provide a use case for this? Is it causing problems as you build your app?

jkallay1 commented 7 years ago

Yes. I'm using the rangeIncomplete event to mark the control as invalid and the rangeSelected event to mark it as valid for client-side validation purposes. This bug requires a special check for the case where both fields are empty in the rangeIncomplete handler.