crab.fit icon indicating copy to clipboard operation
crab.fit copied to clipboard

Incorrect timezone offset when using `Etc/` timezones

Open astrojuanlu opened this issue 3 years ago • 8 comments

Hi! I just discovered crab.fit and the UI is so nice, kudos ✨ Best alternative to when2meet and Doodle I found.

However, I found a bug related to timezones:

Describe the bug Some timezones seem to have wrong offsets.

To Reproduce Steps to reproduce the behavior:

  1. Create a meeting for "days of the week", pick any combination of days, time range 10:00 to 12:00, timezone Etc/UTC (for example this one), land on event page
  2. Change timezone to Etc/GMT+1, observe how time range shifts to 11:00 to 13:00 ✔️
  3. Change timezone to Etc/GMT+2, observe how time range shifts to 10:00 to 12:00 ❌ (expected: 12:00 to 14:00)
  4. Change timezone to Etc/GMT+3, observe how time range shifts to 09:00 to 11:00 ❌ (expected: 13:00 to 15:00)
  5. Change timezone to Europe/Madrid (currently in DST), observe how time range shifts to 14:00 to 16:00 ❌ (expected: 12:00 to 14:00)

Screenshots

Screenshot 2022-05-07 at 20-10-58 Crab Fit Screenshot 2022-05-07 at 20-11-15 Crab Fit

Desktop (please complete the following information):

  • OS: Linux Mint
  • Browser: Firefox and Chromium

Additional context Without this, the app is unfortunately unusable.

astrojuanlu avatar May 07 '22 18:05 astrojuanlu

Disclaimer: I am not part of the developing team, just a user of crab.fit that wants it to work properly and be a true alternative to when2meet.

Crab.fit relies on the dayjs library for this functionality. Maybe you should have a look if the library is responsible for the behaviour you describe. And maybe the library should be updated if the issue has been corrected there.

Etc/GMT+2 is actually -02 according to the IANA database. That does not explain all the issue, but maybe some timezones do not match what their names indicate.

robin-francois avatar Jul 21 '22 08:07 robin-francois

Thanks @robin-francois, and @astrojuanlu for reporting this. Sorry I've been focusing on work projects lately and haven't had the time I'd like to work on Crab Fit. I'll look into dayjs, it's possible I simply need to update to a newer version. The list of timezones I'm using may also not be fully supported by dayjs.

GRA0007 avatar Jul 21 '22 09:07 GRA0007

There are several tickets open on the dayjs repository about timezone issues, more precisely around UTC/GMT: iamkun/dayjs#1843 iamkun/dayjs#1606

Issues could be upstream.

robin-francois avatar Jul 22 '22 10:07 robin-francois

Thanks @robin-francois. I've updated all dependencies in Crab Fit including day.js, however if these issues exist in that library this is likely an issue we'll have to wait for them to resolve. In the meantime, I'd suggest using city-specific timezones, e.g. here in Australia I use Australia/Sydney rather than Etc/GMT+10. Just be wary of daylight savings.

I have looked into other date/time libraries for JavaScript, however day.js is still the best option based on package size and functionality. I'll leave this issue open for now, hopefully these issues can be fixed in the day.js code.

GRA0007 avatar Aug 19 '22 12:08 GRA0007

Thanks for that. I hope @astrojuanlu can still enjoy using crab.fit despite some timezone oddities due to upstream libraries (and confusing timezone names).

robin-francois avatar Aug 26 '22 07:08 robin-francois

Hi @robin-francois, thanks for staying on top of this. Unfortunately this is quite critical so for now I'm left with no alternative other than when2meet. It's unfortunate that dayjs has not solved these issues but the end result is that crab.fit is not usable.

astrojuanlu avatar Aug 26 '22 09:08 astrojuanlu

Have you tried not using Etc/* timezones? As I said, those seem to be misleading by design.

robin-francois avatar Aug 29 '22 07:08 robin-francois

Did a quick test, and it worked with Europe/Madrid and America/Buenos Aires, Europe/Amsterdam, Europe/London 👍🏽 Updating the issue title

astrojuanlu avatar Aug 29 '22 07:08 astrojuanlu

Hey @astrojuanlu, to address mainly this issue and other bugs with dayjs, I've just released a new version of Crab Fit that uses the new Temporal API for dates. If you get a chance would you be able to check if the same issues are happening with the latest version?

GRA0007 avatar Jun 10 '23 12:06 GRA0007

I tried this, but after creating the event in Etc/UTC https://crab.fit/test-meeting-2-933690 with 10:00-12:00 (as I said in the first comment of this thread), changing to Etc/GMT+1 now time range shifts to 09:00-11:00 :x:

image

So, looks like this issue is still not solved.

astrojuanlu avatar Jun 17 '23 17:06 astrojuanlu

@astrojuanlu, unfortunately, this is just how the Etc/GMT timezones work. In the ISO 8601 standard, which defines this list of timezones, Etc/GMT+1 is equivalent to UTC-1. You can read more about this here: https://stackoverflow.com/a/57193723/3855392

To prevent confusion I might add some text after these timezones so it's clear what they are using the UTC standard. E.g. Etc/GMT+1 (UTC-1)

GRA0007 avatar Jun 17 '23 23:06 GRA0007

Woops, I've been wrong all my life 🥲 Then crab.fit is working as expected, and I'm happy to close this issue. Thanks a lot @GRA0007 !

astrojuanlu avatar Jun 18 '23 07:06 astrojuanlu

(For completeness, @robin-francois said this in the very first reply, but I had forgotten again)

astrojuanlu avatar Jun 18 '23 07:06 astrojuanlu