Skip to content
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

How to deal with Gregorian change dates #626

Closed
sffc opened this issue May 27, 2020 · 5 comments
Closed

How to deal with Gregorian change dates #626

sffc opened this issue May 27, 2020 · 5 comments
Labels
calendar Part of the effort for Temporal Calendar API
Milestone

Comments

@sffc
Copy link
Collaborator

sffc commented May 27, 2020

When using a Gregorian calendar, several days were skipped somewhere in the 15th to 19th century when dropping the Julian calendar in favor of modern Gregorian, in order to bring the calendar back into alignment with the sun. However, the time at which these days were skipped, sometimes called the "Gregorian change date", varies from place to place.

How should we encode this in a Temporal calendar API?

  1. Say that "gregory" (why not "gregorian"?) means proleptic Gregorian, and if you want Julian, you have to use the ID "julian" for your date.
  2. Add variants of "gregory", like "gregory-england", "gregory-france", "gregory-scotland", and so forth (see a list here).
  3. Add a subtag that caries data, like "gregory-1752" to indicate that the date change occurred in year 1752.
  4. Other?

@markusicu @poulsbo

@sffc sffc added the calendar Part of the effort for Temporal Calendar API label May 27, 2020
@sffc sffc added this to the Stage 4 milestone May 27, 2020
@poulsbo
Copy link

poulsbo commented May 27, 2020

Maybe it depends on usage. The proleptic Gregorian calendar is commonly used by people who don't care, because they're dealing with post-1970 dates, and they want simpler code. So I think we need that no matter what else.

As for the variants/subtag, the most useful information might come from someone who uses a historically accurate Julian/Gregorian calendar with a cutover date. Do they prefer naming it? Are the names universal and non-controversial?

Absent that, I like the generality of the gregory-nnnn notation, but don't you need two dates? One for the Mar 1 -> Jan 1 transition, another for the Gregorian transition? For example, the following two cases must be distinguished:

Country Start numbered year on 1 January Adoption of Gregorian calendar
Holy Roman Empire (Protestant states) 1559 1700
Sweden 1559 1753

Nit: I probably missed this from an earlier discussion, by why gregory instead of gregorian?

@ptomato
Copy link
Collaborator

ptomato commented May 27, 2020

I'd suggest that we have no more and no less than the calendars supported in 402, where gregory means proleptic Gregorian:

> new Date(Date.UTC(1000, 0, 1)).toLocaleString('en-u-ca-gregory', {timeZone: 'UTC'})
'1/1/1000, 12:00:00 AM'

It seems that 402 currently does not support julian, I don't see it in this list: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar

But this does seem like a good use case for custom calendars! There could be a cookbook recipe to show how to create a hybrid Gregorian/Julian calendar with whatever parameters are needed to implement the changeover correctly.

@gilmoreorless

This comment has been minimized.

@sffc
Copy link
Collaborator Author

sffc commented May 27, 2020

Nit: I probably missed this from an earlier discussion, by why gregory instead of gregorian?

Because UTS 35 standardized "gregory" as the BCP47-compatible identifier. Additional context

But this does seem like a good use case for custom calendars!

Could be. If we think these old dates aren't important enough to make built-in calendars, then we can just punt this problem to user land.

FWIW the IANA database explicitly states that it's based on the proleptic Gregorian calendar.

This discussion is about human calendars. The ISO-8601 calendar is proleptic Gregorian and isn't affected by the question of how to handle Gregorian change dates.

@ptomato
Copy link
Collaborator

ptomato commented Jan 13, 2021

As per #541, it seems that we are not intending to add Gregorian calendars with change dates as built-in calendars, and we've determined that the Temporal.Calendar API is sufficient to allow them as userland calendars, so I think we can close this?

@ptomato ptomato closed this as completed Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
calendar Part of the effort for Temporal Calendar API
Projects
None yet
Development

No branches or pull requests

4 participants