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

Redundant calendar slots for day when DST ends #1044

Closed
anna-kartynnik opened this issue Oct 11, 2018 · 1 comment · Fixed by #1046
Closed

Redundant calendar slots for day when DST ends #1044

anna-kartynnik opened this issue Oct 11, 2018 · 1 comment · Fixed by #1046

Comments

@anna-kartynnik
Copy link
Contributor

Hi guys, first of all I wanted to thank you for your hard work with this amazing calendar.

Do you want to request a feature or report a bug?

report a bug

What's the current behavior?

I tried the demo page and you can find a screenshot below how I see the calendar there:

screen shot 2018-10-10 at 18 15 42

My current local timezone is America/Los_Angeles (UTC-7:00). The problem is that I can see additional two hours in the calendar, so I have two 12 AM and 1 AM slots at the top and at the bottom. Also slot lines for Sunday are not aligned with other days. Note that this problem is reproducible only for week and day view and only for the week (or day) when Daylight Saving Time ends. Here DST ends on the 4th of November, so to reproduce the bug you need to navigate to the view with that date.

What's the expected behavior?

Calendar should be rendered with 24 hours max within a day.

Possible solution

I think the problem is in this line of code. I think instead of

Math.abs(start.getTimezoneOffset() - end.getTimezoneOffset())

we should have

start.getTimezoneOffset() - end.getTimezoneOffset()

I don't think we need to get absolute value here because as far as I understand here we use it for calculating the number of slots and we need to adjust difference accordingly: add 1 hour when DST starts and subtract 1 hour when DST ends.

What do you think? I'll be happy to create a PR if you agree with the solution.

@jquense
Copy link
Owner

jquense commented Oct 11, 2018

I'm never sure what the right answer is with DST but we're happy to take a PR! As long as it seems to work for both the start and end of day I'm happy to merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants