Paul-DS / bootstrap-year-calendar

[DEPRECATED] A fully customizable year calendar widget, for boostrap !
Apache License 2.0
294 stars 243 forks source link

Event selectRange fired when day clicked #240

Open jlainezs opened 5 years ago

jlainezs commented 5 years ago

selectRange event is fired when a day is clicked, so you got two events in one click:

How to solve this? I expect to got the selectRange event only when more than one day is selected, not when one day is clicked. Thanks!

Paul-DS commented 5 years ago

Yes, clicking on a date is considered as selecting a range. If you don't want the both events to be triggered, you can use only the selectRange event, or in the selectRange event listener, check if the startDate and endDate are similar and do nothing in this case.