tc39 / proposal-intl-eradisplay

Intl.DateTimeFormat displays era field only if date displayed is in same era as today's
MIT License
10 stars 4 forks source link

Should we consider hiding lower-power fields in scope? #7

Closed sffc closed 1 year ago

sffc commented 3 years ago

The principle behind the optional display of era names also carries to years and even smaller fields. For example, as a date approaches, one might say,

  1. "November 20, 2021 CE"
  2. "November 20, 2021" if the current era is CE
  3. "November 20" if the current year is 2021 CE
  4. "The 20th" if the current month is November 2021 CE

The question is, should we keep this proposal limited to just eraDisplay, or should we make it more general?

Louis-Aime commented 3 years ago

Yes, this is a good question. My feeling is this: the author should specify the lowest power field he/she wants to display at any case

{ specifyGroup : "month" } => "November. 20" if the current year is 2021 CE, and even if current month is November.

In such a case, month, year and era options are each implicitly set to some value, if not explicitly specified. The month field, and lower power fields if asked, are always displayed. Fields of higher power than month are displayed if they differ from today's.

In certain cases, the author requires the story be displayed as if the present were at a past date. Say we are reporting a story that took place in May, 1945. If we write "the 8th", the reader understands "May 8, 1945". This could be set by { context : "1945-05-01" } (you may use "relative-to" as well). Then, for 1945-05-08, the display shall be "the 8th".

sffc commented 2 years ago

Discussion 2022-02-10: https://github.com/tc39/ecma402/blob/master/meetings/notes-2022-02-10.md#should-we-consider-hiding-lower-power-fields-in-scope-7

Conclusion: Focus in solving the eras issue and look into it in further detail in future

rkirsling commented 1 year ago

I think this is reasonable except for the splitting of era and year. In Japan, the current year is either 2022 or R4 (令和4年) but not just 4(年). Beyond just awkwardness, this would have the potential of incurring confusion between calendar years and year-length durations (as, depending on context, 4年 could also mean "4 years").