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

Hebrew calendar - support or use a constant era? #535

Open
cjtenny opened this issue Feb 10, 2021 · 13 comments
Open

Hebrew calendar - support or use a constant era? #535

cjtenny opened this issue Feb 10, 2021 · 13 comments
Labels
Temporal Issues relating to Intl support in Temporal

Comments

@cjtenny
Copy link

cjtenny commented Feb 10, 2021

Context: tc39/proposal-temporal#1245 (comment)

Should the Hebrew calendar implementation consider a single era with value 'am' or 'ah', or should it not accept any era values?

cc @Manishearth, @justingrant

@Manishearth
Copy link

I think we should use am? But I'm not sure.

@justingrant
Copy link
Contributor

Context: in tc39/proposal-temporal#1245, I added eras to all calendars where the current Date.prototytpe.toLocaleDateString('en-US-u-ca-...') displays an era in the output. Only Hebrew, Chinese/Dangi, and ISO don't display one.

@ptomato
Copy link
Contributor

ptomato commented Feb 10, 2021

This seems like something that will always be controlled by each implementation's underlying locale data.

@justingrant
Copy link
Contributor

This seems like something that will always be controlled by each implementation's underlying locale data.

This is correct. It's out of scope for the Temporal spec.

But we should decide what we want to do in the current polyfill where currently Hebrew and Chinese/Dangi have no eras. Should they have eras? Leave as-is? Should other calendars have no eras too? The current locale data we have access to via Date and DateTimeFormat is ambiguous about Hebrew because the era is present in Date.prototype.toLocaleDateString but is present in DateTimeFormat.prototype.formatToParts. (Referring to Node 15 output with default options.)

BTW, @cjtenny I've started opening up no-262-spec-impact issues that are solely dependent on locale data over in https://github.com/tc39/ecma402 instead of in the Temporal repo. I think it's OK to leave this issue here (unless @ptomato disagrees), but probably best to put future ones over there.

@ptomato
Copy link
Contributor

ptomato commented Feb 10, 2021

I don't object to having it here, but do you mind if I move it over there so that they're all in one place?

@justingrant
Copy link
Contributor

Personally, I'd prefer to move it so we can reduce noise and triage work in this repo.

@ptomato ptomato transferred this issue from tc39/proposal-temporal Feb 11, 2021
@sffc sffc added the Temporal Issues relating to Intl support in Temporal label Feb 11, 2021
@srl295
Copy link
Member

srl295 commented Feb 11, 2021

Context: tc39/proposal-temporal#1245 (comment)

Should the Hebrew calendar implementation consider a single era with value 'am' or 'ah', or should it not accept any era values?

cc @Manishearth, @justingrant

Ah? Don't think this calendar has ah just am

Are you thinking of another calendar ?

@srl295
Copy link
Member

srl295 commented Feb 11, 2021

<calendar type="hebrew">
          <calendarSystem type="lunisolar"/>
          <eras>
              <era type="0" start="-3760-10-7"/>
          </eras>
        </calendar>

@srl295
Copy link
Member

srl295 commented Feb 11, 2021

Ok now I see. Personally I think it could accept an era for orthogonality. Since an era could be visible.

@justingrant
Copy link
Contributor

I think the question is what the era property should return for Temporal.PlainDate and other Temporal objects that use the Hebrew calendar. This came up because the default toLocaleDateString output for the en-US locale doesn't include any era, while all other ICU calendars (except Chinese/Dangi) include era in their default output.

@srl295
Copy link
Member

srl295 commented Feb 11, 2021

@justingrant but by the same token, the gregorian calendar doesn't return a era in the default en-US locale either, although the era is AD. Similarly, for consistency, Hebrew should be AM.

I don't see the purpose of hasEra in the original implementation. Programmatically, just as you wouldn't want a currency amount without a currency ( 123.45 what? CAD? Bitcoin?), so also an era should be part of the data around a Date even if not visible in presentation. So I would propose always having an enumerated era, even if it's a 1-length enumeration.

@cjtenny
Copy link
Author

cjtenny commented Feb 11, 2021

(The suggestion for 'ah' only came from the last line in this wikipedia section and sounds like if an era is supported, 'am' would make more sense).

@srl295
Copy link
Member

srl295 commented Feb 11, 2021

(The suggestion for 'ah' only came from the last line in this wikipedia section and sounds like if an era is supported, 'am' would make more sense).

OK, hadn't heard that, but yes it did confuse me with anno hijri. AM is the usual way it is written in English (well, Latin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Temporal Issues relating to Intl support in Temporal
Projects
None yet
Development

No branches or pull requests

6 participants