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
* Native (*nix): Fix crash
The program used to crash (which couldn't be caught) when the
timezone database was queried with large negative instants
(earlier than year -32767).
* Native (Darwin): improve results outside of supported range
Darwin only supports years [1; 4001], and strange things may happen
when requesting from it to perform arithmetic on dates outside this
range. In particular, when converting NSDateComponents to NSDate,
the era is ignored, and so 32000 BC becomes 32000 AD, which is
absolutely wrong.
Reliance on Darwin auto-adjusting NSDate when converting from
NSDateComponents is the core of our solution to acquire the
timezone database information, but in this case it is better to
completely ignore this API and instead return a plausible-looking
result.
* Native (Windows): return more plausible results
When querying the timezone database outside of the supported range
on Windows, the requested value could be too large to fit in the
platform-provided range. Then, instead of returning a completely
arbitrary result, the call will still return values that could be
naturally acquired for some date in the supported range, instead
of garbage values.
* Native (Darwin): use ISO-8601 calendar
This doesn't change the results in the supported ranges, but it
is more clean conceptually to use the same calendar here as in the
other platforms.
0 commit comments