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

Changes end time when changing date #128

Closed espen closed 3 years ago

espen commented 3 years ago

How to reproduce:

  1. Go to basic example at https://www.jonthornton.com/Datepair.js/

  2. Set start date to current date.

  3. Set time to 2:00am.

  4. Set end time to 5:00am.

  5. Change start date to yesterday. End date is changed to yesterday (as expected). End time is now changed from 5:00am to 3:00am.

Changing the date further does not change the end time.

espen commented 3 years ago

After some investigation it seems like this is an issue in https://github.com/jonthornton/jquery-timepicker/

I'm unable to replicate the issue when using jquery.timepicker 1.13.14. With any newer version I get the outcome in this issue.

jonthornton commented 3 years ago

@espen you're correct, there was an event bubbling bug in jquery.timepicker https://github.com/jonthornton/jquery-timepicker/commit/0873fe4ab3195ecb94245caea829f86c66b191c6

It should be fixed now.

espen commented 3 years ago

New version works perfectly. Thanks @jonthornton 🙏