-
Notifications
You must be signed in to change notification settings - Fork 157
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
Data model for MonthDay #391
Comments
Are there any observable differences among these choices, or is this purely an editorial question? For example, are you picturing any implications on what parameter the constructor takes, or what calendar methods the getters call? |
This doesn't affect ergonomics for most users. However, it does need to be observable because calendar implementations need to be able to access and manipulate these fields, and likely they would need to go onto the constructor. See #354 for more discussion on that point. |
Of the above four solutions I think I have a clear preference for number 4. It seems to have fewer disadvantages and fits naturally with what we already do for the ISO calendar in MonthDay (you could say we have a hardcoded RefYear of 1972.) It would be an issue though, if there is a calendar where it's not possible to pick a single ISO year that contains all of that calendar's possible MonthDays. Does such a calendar exist? |
I do also have a preference for 4. I think 1-3 have fatal flaws.
This is the case in most lunar calendars, such as Hebrew, Islamic, and Chinese. That's why with option 4, |
So basically, rephrased, the proposal on the table for the data model for MonthDay is to use the same fields that would be used for a Date (isoYear, isoMonth, and isoDay). In the ISO calendar, the isoYear is unimportant and can be ignored, but in calendar systems that don't align with ISO, they use the isoYear to determine which particular calendar-specific month and day is being represented. My colleague @echeran pointed out that we can also use this data model for YearMonth, which would eliminate the need for the |
Meeting, March 26: Consensus is to go ahead with this. |
Temporal.YearMonth gets a RefIsoDay internal slot and Temporal.MonthDay gets a RefIsoYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefIsoDay internal slot and Temporal.MonthDay gets a RefIsoYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefIsoDay internal slot and Temporal.MonthDay gets a RefIsoYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefIsoDay internal slot and Temporal.MonthDay gets a RefIsoYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefIsoDay internal slot and Temporal.MonthDay gets a RefIsoYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefIsoDay internal slot and Temporal.MonthDay gets a RefIsoYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefIsoDay internal slot and Temporal.MonthDay gets a RefIsoYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefISODay internal slot and Temporal.MonthDay gets a RefISOYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefISODay internal slot and Temporal.MonthDay gets a RefISOYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefISODay internal slot and Temporal.MonthDay gets a RefISOYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefISODay internal slot and Temporal.MonthDay gets a RefISOYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefISODay internal slot and Temporal.MonthDay gets a RefISOYear internal slot, as discussed in #391. This will be required for calendar support.
Temporal.YearMonth gets a RefISODay internal slot and Temporal.MonthDay gets a RefISOYear internal slot, as discussed in #391. This will be required for calendar support.
Aside from the exception noted in #390, I've convinced myself that the ISO-based data model agreed in #290 is sufficient for Temporal.Date, Temporal.DateTime, and Temporal.YearMonth. However, we need to think more deeply about the data model for Temporal.MonthDay.
We cannot simply map a calendar month onto a Gregorian month, because calendar months can shift alignment each year.
We also cannot simply interpret the numeric month field as being in the specific calendar system, because leap months can share the same numeric month.
Possible solutions:
(IsoMonth, IsoDay) = (2, 1)
since in the ISO year 2000, Shevat 25 landed on February 1.(Month, Day) = ([4, true], 25)
.[[IsLeapMonth]]
slot.[[IsLeapMonth]]
slot would be meaningless to the Gregorian calendar, even in February.[[RefYear]]
slot.(IsoMonth, IsoDay, RefYear) = (2, 1, 2000)
.(IsoMonth, IsoDay, RefYear) = (2, 20, 2020)
.The text was updated successfully, but these errors were encountered: