Skip to content

Commit

Permalink
Fix the bug that time differs by 1 hour from the selected when BST/DS…
Browse files Browse the repository at this point in the history
…T clocks change

[fix #462]

Before this commit the time calculated by the plugin was one hour more
than the time selected by the user when the clocks move forward an hour
and one hour less when the clocks move back for users in BST/DST regions.

This happened because to calculate the selected time, the selected hours
were added to the beginning of the selected day. For example, when user
selected 02:00 on the day when the clocks move forward then the calculated
time was 03:00 because the beginning of the day plus 2 hours is 03:00.
This is due to the fact that at 01:00 the clocks move forward an hour.

For more details see
https://en.wikipedia.org/wiki/British_Summer_Time
https://en.wikipedia.org/wiki/Daylight_saving_time

In this commit the code was changed to use the hour/minute MomentJS
functions to set time:

https://momentjs.com/docs/#/get-set/hour
https://momentjs.com/docs/#/get-set/minute
  • Loading branch information
Hirurg103 authored and monovertex committed Oct 28, 2020
1 parent e305068 commit ef5baaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Loading

0 comments on commit ef5baaf

Please sign in to comment.