Skip to content

fix: add updated era codes to EthiopicHelper#357

Open
kabaros wants to merge 1 commit into
js-temporal:mainfrom
kabaros:patch-1
Open

fix: add updated era codes to EthiopicHelper#357
kabaros wants to merge 1 commit into
js-temporal:mainfrom
kabaros:patch-1

Conversation

@kabaros

@kabaros kabaros commented Mar 26, 2026

Copy link
Copy Markdown

This adds the updated era codes for Ethiopic calendar to reflect the updates in CLDR48 https://cldr.unicode.org/downloads/cldr-48#identifiers

Dealing with Ethiopian calendars started failing in the polyfill in versions of node after 20.19 (and after recent browser updates in Firefox) as ICU updated the era codes: https://unicode-org.atlassian.net/browse/ICU-23167. In the polyfill code, the ecamscript module seems to delegate to call the calendar module passing the updated era code, but the calendar module then can't match the era code failing with RangeError: Era am (ISO year 2016) was not matched by any era.

We observed the failure on CI first as node updated the ICU, but then it started failing on Firefox after an update. It currently works on Chrome stable, but fails with the same error on Canary: https://developers.dhis2.org/demo/?path=/story/calendarinput--ethiopic-with-amharic

@kabaros

kabaros commented Mar 27, 2026

Copy link
Copy Markdown
Author

@ptomato I'd appreciate a review please for this one as it completely broke the Ethiopian calendar for us (or a workaround if there is one!) .. thank you in advance 🙏🏿

@fabon-f

fabon-f commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

@kabaros
Sorry to advertise my project here, but FYI I made another polyfill supporting the latest spec including era codes of Ethiopian. You can use it for now:
https://github.com/fabon-f/temporal-polyfill-lite (You need to use temporal-polyfill-lite/calendars-full entry point for non-ISO calendars)

This adds the updated era codes for Ethiopic calendar to reflect the updates in CLDR48 https://cldr.unicode.org/downloads/cldr-48#identifiers

@ptomato ptomato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. I intend to get the polyfill updated in the next few days to match the status of the proposal at the time of moving to stage 4, and I'll rebase and merge this afterwards.

dhis2-bot added a commit to dhis2/multi-calendar-dates that referenced this pull request Jul 2, 2026
## [2.1.3-alpha.1](v2.1.2...v2.1.3-alpha.1) (2026-07-02)

### Bug Fixes

* **build:** add rootDir and exclude vendor from tsconfig for TS 6.0 ([6a7b2dc](6a7b2dc))
* **ci:** upgrade to Node 20, fix lint errors and formatting ([5fc57bc](5fc57bc))
* **ci:** wire @js-temporal/polyfill-patched alias for cucumber runner ([7864a75](7864a75))
* **ethiopic:** vendor @js-temporal/polyfill with CLDR 48 era-code patch ([ec948fa](ec948fa)), closes [js-temporal/temporal-polyfill#357](js-temporal/temporal-polyfill#357)
* **translations:** sync translations from transifex (main) ([d202f08](d202f08))
* **translations:** sync translations from transifex (main) ([155c81e](155c81e))
* **translations:** sync translations from transifex (main) ([d8e719e](d8e719e))
dhis2-bot added a commit to dhis2/multi-calendar-dates that referenced this pull request Jul 2, 2026
# [2.2.0-alpha.1](v2.1.2...v2.2.0-alpha.1) (2026-07-02)

### Bug Fixes

* **build:** add rootDir and exclude vendor from tsconfig for TS 6.0 ([6a7b2dc](6a7b2dc))
* **ci:** upgrade to Node 20, fix lint errors and formatting ([5fc57bc](5fc57bc))
* **ci:** wire @js-temporal/polyfill-patched alias for cucumber runner ([7864a75](7864a75))
* **ethiopic:** vendor @js-temporal/polyfill with CLDR 48 era-code patch ([ec948fa](ec948fa)), closes [js-temporal/temporal-polyfill#357](js-temporal/temporal-polyfill#357)
* **translations:** sync translations from transifex (main) ([d202f08](d202f08))
* **translations:** sync translations from transifex (main) ([155c81e](155c81e))
* **translations:** sync translations from transifex (main) ([d8e719e](d8e719e))

### Features

* trigger publish ([19fe19c](19fe19c))
kabaros added a commit to dhis2/multi-calendar-dates that referenced this pull request Jul 5, 2026
0.5.x removed Temporal.Calendar/Temporal.TimeZone as registerable
classes entirely - calendars are now plain string identifiers, and
Nepali (the one non-CLDR calendar this library supports) can no longer
be registered as a Temporal.Calendar subclass.

- Vendor 0.5.1 source into src/vendor/temporal/, porting the Ethiopic
  CLDR 48/ICU 76 era-code fix (js-temporal/temporal-polyfill#357,
  still unmerged upstream) to the new calendar module shape.
- Rewrite Nepali support as a standalone NepaliPlainDate class
  (src/custom-calendars/nepaliCalendar.ts) wrapping a real ISO
  Temporal.PlainDate, reproducing the old NepaliCalendar's exact
  "ISO arithmetic, then reconvert" behaviour rather than "fixing" it,
  since existing workarounds (day-14 clamping) depend on it.
- Introduce AnyPlainDate (Temporal.PlainDate | NepaliPlainDate,
  src/utils/plainDate.ts) plus a customPlainDateImplementations
  registry, so hooks/period-calculation code no longer needs to know
  whether a given calendar is Nepali or a real Temporal calendar.
- Switch useDatePicker's internal representation from
  Temporal.ZonedDateTime to Temporal.PlainDate/NepaliPlainDate - a
  date picker never needed time-of-day/timezone semantics.

BREAKING CHANGE: getNowInCalendar now returns a plain CalendarDate
object ({ year, month, day, eraYear? }, src/types.ts) instead of a
Temporal.ZonedDateTime. This removes Temporal from the public
interface entirely and matches convertFromIso8601/convertToIso8601's
existing return shape. Code that only read .year/.month/.day/.eraYear
needs no changes; code that called Temporal methods on the result
needs to re-derive another date via getNowInCalendar/convertFromIso8601
instead of calling .withCalendar()/.startOfDay() on the previous
result.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
dhis2-bot added a commit to dhis2/multi-calendar-dates that referenced this pull request Jul 6, 2026
# [3.0.0-alpha.1](v2.2.0-alpha.3...v3.0.0-alpha.1) (2026-07-06)

* feat(temporal)!: upgrade @js-temporal/polyfill to 0.5.1 ([ade19d5](ade19d5)), closes [js-temporal/temporal-polyfill#357](js-temporal/temporal-polyfill#357)

### BREAKING CHANGES

* getNowInCalendar now returns a plain CalendarDate
object ({ year, month, day, eraYear? }, src/types.ts) instead of a
Temporal.ZonedDateTime. This removes Temporal from the public
interface entirely and matches convertFromIso8601/convertToIso8601's
existing return shape. Code that only read .year/.month/.day/.eraYear
needs no changes; code that called Temporal methods on the result
needs to re-derive another date via getNowInCalendar/convertFromIso8601
instead of calling .withCalendar()/.startOfDay() on the previous
result.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants