iamkun / iamkun/dayjs

1 hour offset when using UTC timezones that have Daylight Saving Time in DateTimePicker

Open
#2,967 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
If I am using the Material UI DateTimePicker https://mui.com/x/react-date-pickers/ and have my timezone as Europe/London or Europe/Lisbon, the moment I click on the calendar date I get an offset of 1h on my timestamp https://codesandbox.io/p/sandbox/3w6yfw but no offset at all if I only click directly on hour or minute. Also, the bug doesn't occur on UTC timezones that do not use Daylight Saving Time such as Africa/Lome or any other timezones.

I have also created this https://codesandbox.io/p/sandbox/datepicker-forked-jygfn7 with Luxon to find out where the bug is coming from and had no offset issues.

**Expected behavior**
No offset when I click on the DateTimePicker calendar day while using DayJs.

**Information**
- Day.js Version v.11.19
- OS: iOS and Windows
- Browser: Chrome, Firefox
- Time zone: GMT 00:00

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.