jonthornton / Datepair.js

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

bootstrap-datepicker changeDate event not firing when maintaining duration #78

Closed gregegan closed 8 years ago

gregegan commented 8 years ago

https://bootstrap-datepicker.readthedocs.io/en/stable/events.html#changedate

It seems like when datepair automatically adjusts the endDate to maintain the duration from a startDate change, a changeDate event never fires.

this.$dateEnd.on('changeDate', () => { console.log('end date changed'); });

gregegan commented 8 years ago

Actually... it looks like rangeSelected can handle this for me rather then a listener on each date/time component

this.$dateRangeContainer.on('rangeSelected', () => { debugger; });

jonthornton commented 8 years ago

Yep, that'll work. You could also do this.$dateRangeContainer.on('changeDate', () => { debugger; }); to capture events from both the start and end inputs.

gregegan commented 8 years ago

👍