Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datepicker crashes with non-standard time intervals #2169

Closed
Afrothundr opened this issue Jun 3, 2020 · 0 comments · Fixed by #2172 or #2350
Closed

Datepicker crashes with non-standard time intervals #2169

Afrothundr opened this issue Jun 3, 2020 · 0 comments · Fixed by #2172 or #2350

Comments

@Afrothundr
Copy link
Contributor

Afrothundr commented Jun 3, 2020

Describe the bug
When using the time select functionality of the datepicker with non-standard time intervals i.e. (18, 27, 40), the datepicker crashes with a runtime error when opened during the first half of the current hour.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the example demo site
  2. Scroll to the Input Time example
  3. Change your computer's time settings to 9:00 am local time
  4. Add the following props to the 'Input TIme' example
timeIntervals={40}
showTimeSelect
  1. Open the datepicker and see the following error: TypeError: Cannot read property 'offsetTop' of undefined

Expected behavior
Should open the datepicker with correct time intervals and auto scrolled to the current time.

Screenshots
image

Desktop (please complete the following information):

  • OS: iOS
  • Browser: Chrome
  • Version: 83

Additional context
Seems to cause an error during the first half of the current hour

Afrothundr pushed a commit to Afrothundr/react-datepicker that referenced this issue Jun 5, 2020
added more logic to time.jsx to account for non standard time intervals

resolves Hacker0x01#2169
martijnrusschen pushed a commit that referenced this issue Jun 6, 2020
added more logic to time.jsx to account for non standard time intervals

resolves #2169

Co-authored-by: Branford Harris <[email protected]>
saltire added a commit to saltire/react-datepicker that referenced this issue Aug 21, 2020
…01#2262)

Centers the time window on the nearest time before or equal to the active time, regardless of its hour.
saltire added a commit to saltire/react-datepicker that referenced this issue Aug 21, 2020
…01#2262)

Centers the time window on the nearest time before or equal to the active time, regardless of its hour.
martijnrusschen pushed a commit that referenced this issue Aug 22, 2020
Centers the time window on the nearest time before or equal to the active time, regardless of its hour.
p-rogas pushed a commit to p-rogas/react-datepicker that referenced this issue Mar 22, 2023
added more logic to time.jsx to account for non standard time intervals

resolves Hacker0x01#2169

Co-authored-by: Branford Harris <[email protected]>
p-rogas pushed a commit to p-rogas/react-datepicker that referenced this issue Mar 22, 2023
…01#2262) (Hacker0x01#2350)

Centers the time window on the nearest time before or equal to the active time, regardless of its hour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant