-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a feature to extend the supported range of dates #886
Comments
this could be supported by the work in #882, just by swapping out the i16 year for i32. This might be better as a seperate type rather than a feature flag such that both types could be used in a single project |
Just a general cleanup of the `Date` builtin to use slightly better patterns and to fix our warnings about deprecated functions. About the regressed tests. It seems to be a `chrono` bug, so I opened up an issue (chronotope/chrono#884) for it and they've already opened a PR fixing it (chronotope/chrono#885). However, while checking out the remaining failing tests, I realized there's a more fundamental limitation with the library. Currently, [`chrono`](https://github.com/chronotope/chrono) specifies: > Date types are limited in about +/- 262,000 years from the common epoch. While the [ECMAScript spec](https://tc39.es/ecma262/#sec-time-values-and-time-range) says: > The smaller range supported by a time value as specified in this section is approximately -273,790 to 273,790 years relative to 1970. The range allowed by the spec is barely outside of the range supported by `chrono`! This is why the remaining `Date` tests fail. Seeing that, I would like to ping @djc and @esheppa (the maintainers of `chrono`) to ask if it would be feasible to add a feature, akin to the `large-dates` feature from the `time` crate, that expands the supported range of `chrono`. EDIT: Filed chronotope/chrono#886
We have no spare bits left in the internal representation of our So this feature either needs a substantial change to chrono's internals and performance characteristics, or it needs the backing type to switch from I don't think a |
At
boa
(A Javascript interpreter) we're usingchrono
to handle the JavascriptDate
builtin; we mainly use it to easily create, parse and format local and UTC datetimes. However, we discovered that several tests were failing because of the supported range of dates by chrono. The README specifies:While the ECMAScript spec mentions:
chrono
's supported range is smaller than the range specified by the spec.The
time
crate has a feature (large-dates
) to extend the allowed range of dates, so we would be very glad to see a similar feature inchrono
that extended its supported range.Thanks!
The text was updated successfully, but these errors were encountered: