-
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
Structure of era: should era field be an integer number ? #968
Comments
With this concept, it is possible to construct custom calendars for each each location in Europe. Take France: Using Intl.DateTimeFormat and "custom locale data register", you could represent all months, weekdays (even Primidi etc.) and eras. |
I agree with all this, but on the other hand, as mentioned in #526 it's an extremely bad experience for API users: Temporal.Date.from({
calendar: 'japanese',
era: 181, // ???
year: 2,
month: 10,
day: 7
}) |
I changed the title of this proposal after @ptomato's comment. I think we all agree that the eras of a calendar are an ordered series of named periods. In principle, this concept could be implemented as an integer value. After all, the series of months is also a series of named periods, and we represent month with an integer number. However, doing so for era could be as complicated as representing a Date with a single number, e.g. the integer Julian day number. |
I think this can be folded into #526. |
The concept of era is only needed for those calendars in which there is a discontinuity in the representation of any kind.
The ISO8601 is designed for having no discontinuity. Always the same reckoning, only one years scale. Hence, there is no need for eras.
Many other calendars have discontinuities at different instants. You designate "eras" the successive periods. The eras are designated with names ("Reiwa", "Common era", "Anno Mundi"., "Saka"), or acronyms ("C.E." or "CE", "A.M."). The names are translated in the different languages. This is similar to months and weekdays.
But for all calendars, the eras may be ordered, starting with the one used for the most ancient dates.
E.g. : "Taika" for
japanese
, Amete Alem forethiopic
, "B.C." or "B.C.E." for the julian calendar used for historical dates.My suggestion is that the
era
optional property of the Temporal objects should be an positive integer number, starting from 0.The question of representing the era with some text should be addressed in the same way as for months and weekdays. In Temporal, those are numbers.
Calendars may have no era, like
iso8601
. era field isundefined
.They may have only one era, which is 0. So are:
buddhist
,ethioaa
,hebraic
,indian
, the five islamic,persian
.Some of them have a first era that counts years backwards from 1:
coptic
,gregory
,roc
.I do not put
chinese
nordangi
in those categories. IMHO, those calendars have no era, but they count years by 60, it is more a question of numbering system for the years.This proposal summarizes comments on #526, #675, #750 (era is deemed as necessary as year, month, day), #889, #901, #902.
The text was updated successfully, but these errors were encountered: