react-timezone-select icon indicating copy to clipboard operation
react-timezone-select copied to clipboard

Returning false value for Jordan(Asia/Amman)

Open Moshappp opened this issue 3 years ago • 4 comments

Describe the bug

Jordan(Asia/Amman) timezone returns +2 Bucharest, while it should be +3 Screen Shot 2023-01-09 at 12 12 19 AM

It might be true that Jordan is +2 but taking into account DST as the library have mentioned it should be +3

Screen Shot 2023-01-09 at 12 12 33 AM

Reproduction

const [selectedTimezone, setSelectedTimezone] = useState("Asia/Amman");

System Info

+2 Bucharest

Used Package Manager

npm

Validations

  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

Moshappp avatar Jan 08 '23 21:01 Moshappp

Okay thanks for the heads up, I'm using the timezone-soft library for most of this. Is it the same there? Try this coesandbox: https://codesandbox.io/s/timezone-soft-test-jb1mq6?file=/src/App.js

ndom91 avatar Jan 31 '23 22:01 ndom91

@ndom91 True soft library returning +2 but if you expanded daylight object inside the console you would find offset is 3. I am not sure how you handle DST, but since you depend on soft library it might for some countries returns values taking into account DST while others not.

Moshappp avatar Feb 09 '23 02:02 Moshappp

We're determining whether to use the dayliglht/standard values based on spacetime.now('Asia/Amman').isDST() output from the spacetime library from the same maintainer as timezone-soft, so I assume they'd be using the same underlying data (like dates when DST happens), but maybe not.

Similar issue here btw: https://github.com/ndom91/react-timezone-select/issues/99

ndom91 avatar Dec 10 '23 14:12 ndom91

I just updated the timezone-soft library to its latest version, can you confirm if this is still an issue? Bucharest is currently (middle of May) displaying as GMT+3:00:

image

Demo: https://ndom91.github.io/react-timezone-select/

ndom91 avatar May 16 '24 14:05 ndom91