Skip to content

feat(temporal)!: upgrade @js-temporal/polyfill to 0.5.1#102

Merged
kabaros merged 1 commit into
alphafrom
fix/vendor-temporal-0.5.1
Jul 6, 2026
Merged

feat(temporal)!: upgrade @js-temporal/polyfill to 0.5.1#102
kabaros merged 1 commit into
alphafrom
fix/vendor-temporal-0.5.1

Conversation

@kabaros

@kabaros kabaros commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

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 (fix: add updated era codes to EthiopicHelper 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.

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>
@codecov-commenter

codecov-commenter commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.98283% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.28%. Comparing base (27dfec4) to head (ade19d5).
⚠️ Report is 1 commits behind head on alpha.

Files with missing lines Patch % Lines
src/custom-calendars/nepaliCalendar.ts 59.32% 24 Missing ⚠️
src/utils/from-any-date.ts 0.00% 2 Missing ⚠️
src/hooks/internal/useNavigation.ts 96.29% 1 Missing ⚠️
src/utils/getNowInCalendar.ts 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            alpha     #102      +/-   ##
==========================================
- Coverage   94.75%   93.28%   -1.47%     
==========================================
  Files          57       58       +1     
  Lines        1258     1296      +38     
  Branches      350      367      +17     
==========================================
+ Hits         1192     1209      +17     
- Misses         65       86      +21     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kabaros
kabaros force-pushed the fix/vendor-temporal-0.5.1 branch from e0ec69d to ade19d5 Compare July 5, 2026 06:51
@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 New issues
2 New Code Smells (required ≤ 0)
1 New Critical Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@cjmamo
cjmamo self-requested a review July 6, 2026 11:47
@kabaros
kabaros merged commit 9e2bafc into alpha Jul 6, 2026
8 of 9 checks passed
@dhis2-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants