-
Notifications
You must be signed in to change notification settings - Fork 153
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
Is daysInMonth
the count of all days or the number of the last day?
#1315
Comments
I think I would assume that In fact, it might be a nice convenience API for a Calendar, or anything with a Year and a Month, to provide the equivalent of: * days(month) {
for (let i = 1; i <= daysInMonth; i += 1) {
yield i;
}
} (i know this isn't accurate but it should convey the gist) That way, nobody would be tempted to use |
We discussed this issue in today's meeting. The consensus was that
Renaming this property (e.g. to |
I don't think we should rename it at this point unless the current name is really found to be problematic in delegate reviews. Other than that, good summary, thanks! |
I agree with all this. The Julian-to-Gregorian transition leads to very funny cases, like 1700 for most Protestant German states. This year of only 355 days was at the same time a leap year (in the beginning) and a common year (since 1 March). February had only 18 days (18 February was followed by 1 March). In reality, the "year" and the "month" are not the same before and after the transition. We switch from one calendar to another, which happen to share the same month names. |
In the experimental development of a class of Western calendars, i.e. calendars that have a Julian-to-Gregorian transition date, I finally took the convention that This seems consistent with the names of the properties and other proposals like #729 ( transferred to Temporal.PlainYearMonth.atEndOfMonth method ). Examples:
On the other hand, I make the week numbering system changes abruptly at the switching date. The current's week number is increased by one the day of switching. In 1701 in Switzerland, weeks are counted is if the year had begun on 1 Jan. This convention can be changed. If well documented, theses cases should not be a problem. They remain exceptions. |
We should make a note about this in CalendarDateDaysInMonth (and maybe ISODaysInMonth) |
Is this not already covered by CalendarDateDaysInMonth (bold emphasis mine)?
|
@gibson042 per #1315 (comment), this definition creates some challenges. Using a definition of "1-based number of the last day of the month" might be a more developer-friendly definition. What do you think? |
That would be a normative change. The operation is specified to return the count of days, not the number associated with the last day (which would be discovered by a different approach, such as "constrain"). |
...rather than e.g. the number of the last day. Fixes tc39#1315
Oops, I completely missed that the comment linked by Justin (#1315 (comment)) actually does say that we decided to make this a normative change. That fell off my radar completely. Note that this has an effect in PlainYearMonth arithmetic, see step 9 of AddDurationToOrSubtractDurationFromPlainYearMonth. |
I added the tag to put it to the agenda for next meeting so we can decide how to handle this. My fault for not catching this earlier! |
Hmm, also relevant for the discussion will be |
Observation: the current text consistently specifies a count of days for all "xInY" properties. Given that, adjusting |
In current Chrome, three Gregorian-derived ICU calendars ( This bug is still unresolved, but feedback from @Louis-Aime in that bug was that we should use proleptic from all of them. @sffc does ICU4X have this inconsistency too? If this bug is resolved to make them all proleptic, then AFAICT there will be no skipped days in any ICU calendars so I assume that no normative changes are needed. Is it worth adding a note to the user-facing documentation of |
My opinion from the meeting:
|
...rather than e.g. the number of the last day. Fixes #1315
Meeting 2023-01-12:
|
…st day Updates PlainYearMonth arithmetic accordingly and clarifies language around non-ISO calendar operations. Fixes #1315
…st day Updates PlainYearMonth arithmetic accordingly and clarifies language around non-ISO calendar operations. Fixes #1315
Should we add a note in the docs of ZonedDateTime that the |
I could go either way, it's an extraordinarily rare situation so it doesn't seem like it needs to be documented. |
…st day Updates PlainYearMonth arithmetic accordingly and clarifies language around non-ISO calendar operations. Fixes tc39#1315
…st day Updates PlainYearMonth arithmetic accordingly and clarifies language around non-ISO calendar operations. Fixes #1315
…st day Updates PlainYearMonth arithmetic accordingly and clarifies language around non-ISO calendar operations. Fixes #1315
…f days in a month This change affects how PlainYearMonth's add and subtract behave. They now ignore daysInMonth reimplementations in the calendar, and they call dateadd() a different number of times. See tc39/proposal-temporal#1315
…f days in a month This change affects how PlainYearMonth's add and subtract behave. They now ignore daysInMonth reimplementations in the calendar, and they call dateadd() a different number of times. See tc39/proposal-temporal#1315
…f days in a month This change affects how PlainYearMonth's add and subtract behave. They now ignore daysInMonth reimplementations in the calendar, and they call dateadd() a different number of times. See tc39/proposal-temporal#1315
…r of the last day Updates PlainYearMonth arithmetic accordingly and clarifies language around non-ISO calendar operations. Fixes #1315 Co-authored-by: Guillaume Emont <[email protected]>
Days can be skipped, either by calendars (e.g. Julian-to-Gregorian transition) or by time zone changes (e.g. Samoa's 2011 change to the other side of the International Date Line.
How should
daysInMonth
be affected by these skipped days?The text was updated successfully, but these errors were encountered: