Skip to content

[Bug]: TimePicker incorrectly handles daylight saving change #29783

@rocketBANG

Description

@rocketBANG

Library

React / v8 (@fluentui/react)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 12.78 GB / 31.71 GB
  Browsers:
    Edge: Chromium (118.0.2088.76)
    Internet Explorer: 11.0.22621.1

Are you reporting Accessibility issue?

None

Reproduction

https://codepen.io/rocketbang/pen/qBgrEZW

Bug Description

Actual Behavior

When selecting a date anchor on a day when a daylight saving change happens, the TimePicker displays duplicate times
example November 5, 2023 00:00:00 in PST timezone
image

The bigger issue is even using the timezone offset value of these given dates and trying to format (using onFormatDate) that shows that the duplicated 1:00 and 1:30 dates have the timezone value set incorrectly
https://codepen.io/rocketbang/pen/NWopPRX

image

There's also the issue of duplicated keys showing up regardless of how onFormatDate is used due to the TimePicker generating keys without the timezone
image

Expected Behavior

  1. I would expect that the dates received in onFormatDate have their timezone set correctly
    e.g. in the above timezone screenshot it should be 00:30 TZ 420, 1:00 TZ 420, 1:30 TZ 420, 1:00 TZ 480, 1:30 TZ 480, 2:00 TZ 480
    This allows users of this component to display the timezone correctly to the user when needed
  2. With that fixed some default behaviour to handle the daylight saving change when generating unique keys so the warning does not show up

Logs

No response

Requested priority

Blocking

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions