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

End time dropdown does not display all the options when < 24 hours from start #105

Open mattfeury opened 6 years ago

mattfeury commented 6 years ago

Hi all,

This is a little tough for me to explain, but I can reproduce it reliably on the basic example.

Steps to reproduce:

  1. Set start date, e.g. Jan 17 2018 (At this point, both start and end dates are accurate set to this day. so far so good)

  2. Set start time to 12:00 noon. At this point, start is Jan 17 noon and end is Jan 17 1pm. so far so good

  3. Set end date to Jan 18 2018 and set end time to 10am. At this point, start is Jan 17 noon and end is Jan 18 10am. so far so good.

  4. Now click on the end time field (the 10am one). You'll notice it no longer goes past "11:30am (23.5 hours)".

This seems like a bug to me or maybe i'm just missing a setting. There is no way for me to change the end time to Jan 18 2pm, for example. See screenshot below:

image

Is this behavior intentional? It seems weird to have different behavior based on the range from start to end datetime.

thanks!

jonthornton commented 6 years ago

Thanks for the detailed steps to reproduce. What happens if you scroll up on the list of times?

mattfeury commented 6 years ago

it will essentially just show the next 24 hours so i can scroll all the way up to "0 mins" duration and all the way down to "23 hours" duration (12pm -> 11am in my example).

selecting "6pm (6 hours)" actually selects 1/17 6pm even though the end date is 1/18.