You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey Ernie, ya - you're right about this being a really weak part of the library, and a source of confusion for me as well.
I'm welcome to ideas for fixing it, or clarifying the situation in the docs.
I have considered requiring a tz as a 2nd param, but in so many cases, people are working locally, and don't want to think about timezones.
ya - if you pass an offset in the ISO string, it tries to guess which IANA it should be. The confusion comes from this implicit IANA. it's not an error, because it's a valid use-case. We also can't introduce a breaking change, without a major version, which I want to avoid.
Understood. Yeah not too sure about the internals here, but maybe just a console.warning if you pass in a string with a timezone plus a timezone? "Passed in timezone will be ignored, being inferred from ISO string with offset" something like that.
I incorrectly was trying to do something like:
spacetime('2024-09-23T16:15:12.519+00:00', 'America/New_York')
thinking it would adjust this timestamp to my timezone.Ultimately, what I wanted was
spacetime('2024-09-23T16:15:12.519+00:00').goto("America/New_York")
.It feels like the first call should throw an error of some sort if you pass in a timezone when one is already specified?
The text was updated successfully, but these errors were encountered: