Skip to content

Conversation

@ben-allen
Copy link
Collaborator

@ben-allen ben-allen commented Dec 4, 2025

Following guidance in issue #29 conversation, this PR causes the value of "ca" to be removed from the _options_ of CreateDateTimeFormat when the value of _options_.[[ca]] is "islamic-rgsa". This calendar matches no calendar in actual use and should be ignored.

fix #94

Following guidance in [issue tc39#29 conversation](tc39#29 (comment)), this PR causes the value of `"ca"` to be removed from the `_options_`
of `CreateDateTimeFormat` when the value of `_options_.[[ca]]` is
"islamic-rgsa". This calendar matches no calendar in actual use and
should be ignored.
@sffc sffc moved this to Priority Issues in ECMA-402 Meeting Topics Dec 4, 2025
@ryzokuken ryzokuken force-pushed the issue-29-hijri-calendars branch from cff02fb to 3ade73a Compare December 4, 2025 17:05
@ryzokuken ryzokuken changed the title Normative: Ignore "islamic-rgsa" calendar option Normative: Ignore "islamic-rgsa" calendar in DateTimeFormat Dec 4, 2025
Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the discussion from yesterday's TG2 I think here's what we need to change in this PR:

  • delete the added text, it's no longer relevant
  • delete the "islamic-rgsa" from the If-clause a few lines lower down
  • change the fallbackCalendar and CanonicalizeUValue lines to simply "Set resolvedCalendar to "islamic-tbla"."
  • in AvailableCalendars, change "The List must include" to "The List must consist of"

@sffc
Copy link
Collaborator

sffc commented Dec 9, 2025

@sffc
Copy link
Collaborator

sffc commented Dec 9, 2025

@ben-allen ben-allen force-pushed the issue-29-hijri-calendars branch from 3ade73a to be6c4b1 Compare December 10, 2025 17:16
@ben-allen
Copy link
Collaborator Author

ben-allen commented Dec 10, 2025

Updated per @ptomato's suggestion

Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't occur to me before, but I think this section also needs to change. At least "even if supporting only the calendars from Table 1" needs to be rephrased, since it's now required to support only the calendars from Table 1.

Possibly something like "This list may include calendar types not listed in Table 1"?

…ion for internal slots of Intl.DateTimeFormat constructor
Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized we additionally need to comb through the proposal and remove any language that says "If calendar is not listed in Table 1, return an implementation-defined value" — that will no longer be allowed.

…bleCalendars`, no longer "must include" all the calendar types in Table 1 (Calendar types described in CLDR), but instead must entirely consist of the calendar types in Table 1. As a result, `AvailableCalendars` and two other AOs:

* `CalendarExtraFields`
* `NonISOFieldKeysToIgnore`

are likewise not implementation-defined. Steps in these AOs returning
implementation-defined values for calendar types not in Table 1 have
been removed.
@ben-allen
Copy link
Collaborator Author

As of the last commit this PR would fix #94

@hsivonen
Copy link
Member

Is there anything in particular blocking this from landing?

@ptomato
Copy link
Collaborator

ptomato commented Jan 6, 2026

It needs to be presented to TG1, no?

@sffc sffc moved this from Priority Issues to Previously Discussed in ECMA-402 Meeting Topics Jan 8, 2026
@ben-allen ben-allen moved this from Previously Discussed to Priority Issues in ECMA-402 Meeting Topics Jan 8, 2026
Copy link
Member

@hsivonen hsivonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

<dl class="header">
<dt>description</dt>
<dd>The returned List is sorted according to lexicographic code unit order, and contains unique calendar types in canonical form (<emu-xref href="#sec-calendar-types"></emu-xref>) identifying the calendars for which the implementation provides the functionality of Intl.DateTimeFormat objects, including their aliases (e.g., <del>either</del> both <del>or neither of</del> *"islamicc"* and *"islamic-civil"*). The List must include <del>*"iso8601"*</del><ins>the Calendar Type value of every row of <emu-xref href="#table-calendar-types"></emu-xref>, except the header row</ins>.</dd>
<dd>The returned List is sorted according to lexicographic code unit order, and contains unique calendar types in canonical form (<emu-xref href="#sec-calendar-types"></emu-xref>) identifying the calendars for which the implementation provides the functionality of Intl.DateTimeFormat objects, including their aliases (e.g., <del>either</del> both <del>or neither of</del> *"islamicc"* and *"islamic-civil"*). The List must consist of <del>*"iso8601"*</del><ins>the Calendar Type value of every row of <emu-xref href="#table-calendar-types"></emu-xref>, except the header row</ins>.</dd>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"consist of" implies that the returned list must be constrained to the following table, which is not the case.

Suggested change
<dd>The returned List is sorted according to lexicographic code unit order, and contains unique calendar types in canonical form (<emu-xref href="#sec-calendar-types"></emu-xref>) identifying the calendars for which the implementation provides the functionality of Intl.DateTimeFormat objects, including their aliases (e.g., <del>either</del> both <del>or neither of</del> *"islamicc"* and *"islamic-civil"*). The List must consist of <del>*"iso8601"*</del><ins>the Calendar Type value of every row of <emu-xref href="#table-calendar-types"></emu-xref>, except the header row</ins>.</dd>
<dd>The returned List is sorted according to lexicographic code unit order, and contains unique calendar types in canonical form (<emu-xref href="#sec-calendar-types"></emu-xref>) identifying the calendars for which the implementation provides the functionality of Intl.DateTimeFormat objects, including their aliases (e.g., <del>either both or neither of</del><ins>both</ins> *"islamicc"* and *"islamic-civil"*). The List must include <del>*"iso8601"*</del><ins>the Calendar Type value of every row of <emu-xref href="#table-calendar-types"></emu-xref>, except the header row</ins>.</dd>

1. Assert: IsValidMonthCodeForCalendar(_calendar_, _monthCode_) is *true*.
1. If YearContainsMonthCode(_calendar_, _arithmeticYear_, _monthCode_) is *true*, return _monthCode_.
1. If _overflow_ is ~reject~, throw a *RangeError* exception.
1. If _calendar_ is not listed in the Calendar Type column of <emu-xref href="#table-calendar-types"></emu-xref>, return an implementation-defined value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these implementation-defined steps being removed? AFAIK, they are necessary to retain for implementations supporting non-required calendar types to still be conforming.

        1. If _calendar_ is not listed in the Calendar Type column of <emu-xref href="#table-calendar-types"></emu-xref>, return an implementation-defined value.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the conclusion from TG2, that implementations supporting non-required calendar types should not be conforming: https://docs.google.com/document/d/1AIsV-xXMWZ6fUX27Gw1UsIswmfcMZEjhdz3adla8lso/edit?tab=t.0#heading=h.vtb7plo5cjtx

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a point raised, but AFAICT not a conclusion. But at any rate, the contents of this PR currently lack internal consistency regarding whether or not the list is exhaustive.

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

<ul>
<li><ins>[[LocaleData]].[[&lt;_locale_>]].[[ca]] must be a List consisting of calendar types. Specifically, even if supporting only the calendars from <emu-xref href="#table-calendar-types"></emu-xref>, the list may also include *"islamic"* and *"islamic-rgsa"*.</ins></li>
<li><ins>[[LocaleData]].[[&lt;_locale_>]].[[ca]] must be a List consisting of calendar types. It may include calendar types not listed in <emu-xref href="#table-calendar-types"></emu-xref>.</ins></li>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, any browser calendar values from locales should only be supported Temporal calendars. An explicit -u-ca need not be supported, but the CLDR data needs to all be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Priority Issues

Development

Successfully merging this pull request may close these issues.

Restrict AvailableCalendars to exactly return the elements of Table 1?

5 participants