-
Notifications
You must be signed in to change notification settings - Fork 163
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
Fewer CalendarFields/DateFromFields calls during many PlainYearMonth ops #2794
Comments
Long story, but I'm not sure we can assume that tl;dr ICU may in the future get a historically accurate Julian-Gregorian calendar, which skips 10 days in October 1582. (Or some later date, depending on how quickly the jurisdiction adopted the calendar reform.) The This isn't a concern with any current builtin calendar, but we decided that we need to be robust against it. |
Wow, I'll add that to the list of strange things I've learned about calendar systems! Makes sense that Closing this issue. |
@arshaw You may want to take a look at these sections in the docs:
Feel free to PR additions/edits to those docs if you learn something strange about calendars that isn't represented there! |
For these PlainYearMonth operations...
...it essentially converts to a PlainDate by going to the start-of-month, then carries out its operation, then converts back to PlainYearMonth.
To convert to the start-of-month, it uses a very heavyweight set of operations:
It's much more efficient to leverage the CalendarProtocol's
day()
method to move to the start-of-month. Here's what fullcalendar's polyfill does:I'll experiment with making the reference polyfill do this. I'll open a PR...
The text was updated successfully, but these errors were encountered: