jonthornton / Datepair.js

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

Date not cycling properly. #23

Closed danielsmacdonald closed 10 years ago

danielsmacdonald commented 10 years ago

When a start time like 11:30pm is selected and it forces the end time to midnight or later, usually the end date will change to startdate + 1 day. This is expected and works well except when you initially set the start time (from blank).

This fiddle demonstrates: http://jsfiddle.net/slicedtoad/uzdbnzwo/1/

Set the start date to anything. Then set the start time to 11:30pm. The end time will be past midnight and the end date will be the same as the start date instead of plus one. And it will trigger a rangeSelected event instead of a rangeError.

jonthornton commented 10 years ago

Thanks for including an example! You made this really easy to fix.