-
Notifications
You must be signed in to change notification settings - Fork 155
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
Some Calendar questions #1425
Comments
I will try to address all the other points later but as for (1) there is an existing discussion starting at #1294 (comment). tl;dr: Yes, that would be possible, and has some advantages, but leads to existing PlainWhatever and ZonedDateTime objects being broken if Temporal.Calendar.prototype is mutated, and it's my opinion that that the advantages don't weigh strongly enough. |
Sweet, thanks for the pointer. |
(2) Sure, that seems harmless. (3) I don't think it was intentional. We can just change this. (4) In, for example, Temporal.PlainDateTime.compare(), if the dates are the same but the calendars are different, then the function needs to return -1 or +1 in order to have some sort order, so we picked lexicographical comparison of the calendar ID. Previous discussion on this and rationale in #588 and #625. |
No, it doesn't. Returning |
Of the above points I believe that only (2) and (3) still apply, and (2) is normative, so I'll make sure that gets done before we say that the Stage 3 conditions have been resolved. |
Note that (2) applies equally to TimeZoneEquals. |
In CalendarEquals, TimeZoneEquals, and ConsolidateCalendars, remove the observable toString() calls from the path where both calendars are the same object. See: #1425
In CalendarEquals, TimeZoneEquals, and ConsolidateCalendars, remove the observable toString() calls from the path where both calendars are the same object. See: #1425
In CalendarEquals, TimeZoneEquals, and ConsolidateCalendars, remove the observable toString() calls from the path where both calendars are the same object. See: #1425
delegate review: Calendar and TimeZone should be brand-checked, not normal, objects #1294 Is there a reason Calendars are passed around as objects, instead of eagerly getting all the methods and passing those around? That would also help with validation. (Sorry if there's discussion of this somewhere.)
In CalendarEquals there are observable ToString calls. It might be worth doing a preemptive strict equality check, so that the common case of comparing a calendar to itself can avoid calling any user code.
The documentation says "calendar.fields [...] is called indirectly when using the from() static methods and with() methods". It's called in a lot more places than that, e.g. in toPlainYearMonth (via CalendarFields); is that omission intentional?
Why does CompareCalendar exist? I do not tend to think of calendars as being comparable.
The text was updated successfully, but these errors were encountered: