Closed Chrischuck closed 4 years ago
hi Chris, yeah, are you using some library to generate an Iana from the ip?
you can add a custom timezone like this: https://runkit.com/spencermountain/5e3d96db5accc10014e2d768
I'm using maximind for the iana timezone, which I don't believe causes any errors.
If I add a custom timezone say at the entrypoint of my app, will that be reflected everywhere I import spacetime from?
ah, i don't actually know.
try to track it down. I'd be happy to at cet as a edge-case if it is coming from the device itself.
i just did a grep in spacetime and doubt it comes from us. Let me know!
Will do @spencermountain, it's super odd and we've been battling this error for like a month...it ONLY happens on Xiaomi devices 🤦♀️
@spencermountain I was finally able to repro this on firefox and it's happening when I add/subtract from the spacetime object. someTime.subtract(i, 'day');
I had to follow this
And then change the common name to "cet" so Intl.DateTimeFormat().resolvedOptions().timeZone
would return "cet" in the browser.
This is super edge case again and it's really been a thorn in our side since we haven't been able to repro until now. So thank you again for your help :)
I'm a dummy, I wrapped spacetime in a function and forgot to pass the timezone into that function so it defaulted to browser TZ since it was undefined...
But I'm going going to leave this comment up so others know how to change their timezone to some of the unconventional stuff out there in the wild.
no sweat! good eye.
Related to this issue: https://github.com/spencermountain/spacetime/issues/181
But I'm getting this error
Spacetime: Cannot find timezone named: 'cet'. Please enter an IANA timezone id.
a lot in production on xiaomi devices.I don't have any xiaomi devices or don't know how to repro this locally so it's been a shot in the dark to try and track this error down.
What I've done, since we use the IP to get the timezone on the server, is to make sure whenever
spacetime
is called, we pass it that timezone (which is IANA). so we'd always havespacetime.now(TIMEZONE)
orspacetime(DATE, TIMEZONE)
.Unfortunately, we still get this error, do you know any entry points that would cause this error to occur?