GMT+00 Casablanca is in the wrong time zone
Describe the bug
Casablanca appears as GMT+0, but currently it is in +1. I noticed that issue is probably with timezone-soft as they report it as UTC+00, but my browser renders any time set to Africa/Casablanca as UTC+01
Edit:
Actually timezone-soft seems correct, this is what it reports. Morocco is most of the year in standard (UTC+1), with the daylight used during Ramadan but that ended the 1st Sunday of May.
Is it just that react-timezone-select uses the long name provided by this timezone-soft?
{
"name": "Morocco Standard Time",
"iana": "Africa/Casablanca",
"standard": {
"abbr": "WET",
"offset": 1,
"name": "Morocco Standard Standard Time"
},
"daylight": {
"abbr": "WEST",
"offset": 0,
"name": "Western European Summer Time",
"start": "last-sun-mar-3h",
"end": "1st-sun-may-2h"
},
"long": "(UTC+00:00) Casablanca"
}
Reproduction
https://ndom91.github.io/react-timezone-select/
System Info
Your own demo, browsed on Chrome/windows (latest)
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.
Hey thanks for bringing this up. So it looks like the info we're getting from timezone-soft is correct, but we're just not rendering the correct one (daylight savings vs. non-daylight savings times)? Did I understand that correctly?
Yeah the option rendered says GMT +0:00, yet the timezone right now in Casablanca is GTM+1 (https://www.timeanddate.com/worldclock/morocco/casablanca)
Not sure where the issue is, but the response from timezone-soft says "long": "(UTC+00:00) Casablanca", is that what you use to render the label? Because that long name is not correct.
Hmm yeah no so we stitch together the standard.offset, standard.abbr, or the daylight variant. Depending on whether spacetime.now('Africa/Casablanca').isDST() returns true or false.. :thinking:
Same issue here btw: https://github.com/ndom91/react-timezone-select/issues/83
Where determining when DST is occuring / whether to use daylight/standard values is being incorrectly calculated :thinking:
Hi @ndom91 - we just noticed the same thing; it looks like this is due to the underlying use of spacetime. See https://github.com/spencermountain/spacetime/issues/402
Spacetime isn't DST aware.