electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.2k stars 350 forks source link

Unrecognized time zone identifier: "Europe/Kyiv" #343

Open cawa-93 opened 1 year ago

cawa-93 commented 1 year ago

🐞 Describe the bug

On live demo I got this error:

unrecognized time zone identifier: "Europe/Kyiv"

πŸ“š To Reproduce

  1. Open demo
  2. Try to Sign in

πŸ’‘ Expected behavior

Just normaly work

πŸ–ΌοΈ Screenshots

зобраТСння

βš™οΈ Environment Live demo from README πŸ€·β€β™‚οΈ Browser: Firefox Developer edition v105.0b9

πŸ“‹ Additional context

In my opinion it may be related to recently renaming timezone Europe/Kiev to Europe/Kyiv

https://mm.icann.org/pipermail/tz-announce/2022-August/000071.html

electerious commented 1 year ago

Thanks for letting me know!

In my opinion it may be related to recently renaming timezone Europe/Kiev to Europe/Kyiv

I think that's the problem. I'm using date-fns-tz to work with timezones. A new version of the package might already support Europe/Kiev. A PR is welcome!

cawa-93 commented 1 year ago

Regarding to https://github.com/marnusw/date-fns-tz/issues/120#issuecomment-828365540 it may be caused by mismatched nodejs timezones and browser timezones.

In firefox v105.0b9:

> Intl.DateTimeFormat().resolvedOptions().timeZone 
< 'Europe/Kyiv'

In edge v105.0.1343.42:

> Intl.DateTimeFormat().resolvedOptions().timeZone 
< 'Europe/Kiev'

But in node v18.8.0

> new Intl.DateTimeFormat('en-US', {timeZone: 'Europe/Kyiv'}).format(Date.now())
Uncaught RangeError: Invalid time zone specified: Europe/Kyiv
    at new DateTimeFormat (<anonymous>)
> new Intl.DateTimeFormat('en-US', {timeZone: 'Europe/Kiev'}).format(Date.now())
'9/20/2022'

Node already updated https://github.com/nodejs/node/issues/44333

cawa-93 commented 1 year ago

Confirm. In node 18.9.0 both timezone works.

> new Intl.DateTimeFormat('en-US', {timeZone: 'Europe/Kyiv'}).format(Date.now())
'9/20/2022'
> new Intl.DateTimeFormat('en-US', {timeZone: 'Europe/Kiev'}).format(Date.now())
'9/20/2022'

Therefore, I assume that updating the node on the demo server should solve this problem

electerious commented 1 year ago

I've updated date-fns-tz with Ackee 3.4.2. Can you check if the bug has been fixed?

cawa-93 commented 1 year ago

Yeap. Still not working in firefox 109.0b3 on windows 10

mks-h commented 9 months ago

This is still an issue