Skip to content

One hour added to time when selecting date in DST with a fixed timezone. #1059

Closed
@aostijn

Description

@aostijn

Hi! First of all, thanks a lot for the work on this tool, it's great! I ran into an issue that somewhat resembles #991 but doesn't seem to be entirely the same (#991 occurred in 9.0.3 and should be fixed with 10.0.0 but for my problem, it's the opposite), so I created this bug report.

Describe the bug
I provide a fixed timezone with the timezone string prop (in my case: 'Europe/Brussels'). At the time of writing (December), we're in winter time, so outside of DST. When I choose a date and time outside of DST (for example in January), everything works as expected. But when I choose a date and time inside of DST (for example in June), when I confirm, one hour is added to the time I chose.

Some notes that might be useful:

  • This problem doesn't happen when I don't provide a timezone and I let the datepicker use the local timezone (which also happens to be Europe/Brussels).
  • The problem occurs the other way around too: when I'm inside DST (for example in June) and I pick a date outside DST (for example in January), one hour is subtracted from the time I chose.
  • This problem only started occurring in version 10.0.0. I didn't have the problem with version 9.0.3.

To Reproduce
Steps to reproduce the behavior:

  1. Go to this example in 10.0.0 with the problem
  2. Click on the datepicker.
  3. Choose a date and time in June if you're currently in winter time (or vice versa: pick a date in January if you're currently in summer time).
  4. Confirm the date and time.
  5. Notice how the resulting time is one hour later than the one chosen (or one hour before if you're currently in summer time).

Expected behavior
The time should be the same as selected.

Screenshots
Arc_8V2vaHYVn2

Desktop & mobile (please complete the following information):

  • Browser: Chrome Version 131.0.6778.140 (Official Build) (64-bit)
  • Library version: 10.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions