arqex / react-datetime

A lightweight but complete datetime picker react component.
1.99k stars 873 forks source link

displayTimeZone prop doesn't affect output date #793

Open Taelkir opened 3 years ago

Taelkir commented 3 years ago

I'm Submitting a ...

[x] Bug report
[ ] Feature request
[?] Support request

Steps to Reproduce

  1. Pass either 'Europe/London' or 'America/New_York' to displayTimeZone prop.
  2. Observe the output date not be affected.

Expected Results

The output date should be displayed in the given timezone.

Actual Results

The output date stays in my local timezone.

Minimal Reproduction of the Problem

Here's a codesandbox displaying the dates. Changing the timezone at the top from 'Europe/London' (for me) to 'America/New_York' does not change the value of the date from GMT+0100 (British Summer Time) to anything else. https://codesandbox.io/s/27dmd?file=/src/App.js:1088-1103

Other Information (e.g. stacktraces, related issues, suggestions how to fix)

Not sure if this a problem with the library or just my code - any suggestions would be appreciated.