Skip to content

fix(deps): bump @dhis2/multi-calendar-dates to 3.2.1 - #1873

Open
kabaros wants to merge 5 commits into
masterfrom
chore/bump-multi-calendar-dates
Open

kabaros wants to merge 5 commits into
masterfrom
chore/bump-multi-calendar-dates

Conversation

@kabaros

@kabaros kabaros commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Note

This migration was guided by the multi-calendar-dates-upgrade skill (dhis2/ai-devtools#4).

Summary

Supersedes #1870 (DHIS2-21183). It makes the same dependency bump, to 3.2.1 instead of 3.0.0, and adds regression snapshots that verify the period lists across calendars. #1870 can be closed in favour of this one.

Bumps @dhis2/multi-calendar-dates ^1.2.2 → ^3.2.1, and the @dhis2/ui dev dependency ^10.19.0 → ^10.19.3. The ^10 peer range is unchanged.

Apps that use analytics' period selectors currently bundle analytics' own multi-calendar-dates 1.3.2 and @js-temporal/polyfill 0.4.3 next to their own 3.x copy. 1.3.2 throws Era am … was not matched by any era for every Ethiopian date on current browsers. I swapped this branch's build into maps-app and rebuilt it: its bundle went from three copies (multi-calendar-dates 3.2.1 and 1.3.2, polyfill 0.4.3) to multi-calendar-dates 3.2.1 only.

Changes

  • deps: @dhis2/ui 10.19.3 first, since 10.19.0 pinned multi-calendar-dates 2.1.2, then multi-calendar-dates 3.2.1. The lockfile has single copies of multi-calendar-dates (3.2.1) and the polyfill (0.5.1).
  • No code changes needed: analytics only uses getNowInCalendar (reading .eraYear/.year) and generateFixedPeriods, whose inputs and outputs are unchanged. eraYear || year is now eraYear ?? year, and an outdated comment about Temporal is replaced.

Regression snapshots

PeriodDimension/__tests__/multiCalendarDates.regression.spec.js covers getFixedPeriodsOptionsById(...).getPeriods for 13 period types, and PeriodTransfer's default year and period list. It runs for gregory, ethiopian, nepali and islamic, with "now" pinned to three dates. The baseline was taken on 1.3.2, in its own commit.

  • gregory, islamic: unchanged.
  • ethiopian: fixed. It threw on 1.3.2; the baseline was captured with the polyfill patched locally, and that patch isn't committed. Dates are unchanged, and period names lose a wrong AA (Amete Alem) suffix, e.g. Meskerem 2016 AA → Meskerem 2016.
  • nepali: periods ending in Nepali year 2082 now end on the right day. 1.3.2's month lengths for 2082 were wrong; 3.2.1 matches the published calendar.

Maintainers may delete the regression test and its snapshot once this is confirmed.

Test plan

  • yarn test (104 suites), yarn lint, yarn build
  • Check the period selector on an Ethiopian and a Nepali instance

Warning

Existing bugs, not fixed in this PR (both happen on 1.3.2 as well):

  • filterFuturePeriods parses calendar dates with new Date(). For non-Gregorian calendars it filters the wrong periods: Nepali returns no current-year periods, and Ethiopian and Islamic return future ones.
  • getFixedPeriodsOptions ignores the periodsSettings that PeriodTransfer passes in. The fixed period list is therefore always Gregorian, while the year field uses the server calendar.

🤖 Generated with Claude Code

kabaros and others added 4 commits October 15, 2026 15:37
@dhis2/ui 10.19.0's @dhis2-ui/calendar pinned @dhis2/multi-calendar-dates
2.1.2; 10.19.3 asks for ^3.1.0. The lockfile now has a single copy of the
@dhis2/ui packages. The ^10 peer dependency range is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Snapshots getFixedPeriodsOptionsById(...).getPeriods for 13 period types,
and PeriodTransfer's default year and period list, for gregory,
ethiopian, nepali and islamic, with "now" pinned to three dates. The
baseline was taken on @dhis2/multi-calendar-dates 1.3.2.

On Node 24 (CLDR 48), 1.3.2's @js-temporal/polyfill 0.4.3 throws
"Era am ... was not matched by any era" for every Ethiopian date, so the
Ethiopian baseline was captured with that polyfill patched locally. The
patch is not committed: the Ethiopian cases fail on 1.3.2 until
multi-calendar-dates 3.x, which has the fix, lands in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixed period lists (getFixedPeriodsOptionsById) and PeriodTransfer's
default year now use multi-calendar-dates 3.2.0. Its getNowInCalendar
returns a plain object, but analytics only reads .eraYear/.year from it,
so no code changes were needed. The lockfile now has a single copy of
multi-calendar-dates (3.2.0) and @js-temporal/polyfill (0.5.1).

Regression snapshot changes, all intended:
- ethiopian: every call threw "Era am ... was not matched by any era" on
  1.3.2 with current ICU data (the baseline was captured with the
  polyfill patched). On 3.2.0 the dates are the same, and period names
  lose the "AA" (Amete Alem) suffix, which was wrong: the years shown
  (e.g. 2016) are Amete Mihret years.
- nepali: periods ending in 2082 end on the correct day. 1.3.2's month
  lengths for Nepali year 2082 were wrong; 3.2.0's table matches the
  published 2082 BS calendar (Ashadh 32 days, Ashwin 31, Magh 29).
- gregory and islamic: unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
multi-calendar-dates 3.x leaves eraYear undefined for calendars without
eras (e.g. Islamic). || and ?? behave the same here, since eraYear is
never 0, but ?? states the intent. Also replaces a comment about a
pending Temporal decision, which no longer applies since 3.x doesn't
expose Temporal objects. The regression snapshots are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.2.1 only corrects Nepali calendar data (dhis2/multi-calendar-dates#108).
The regression snapshots are unchanged: they cover Nepali years 2081-2082,
whose data did not change. yarn.lock is deduplicated so @dhis2/ui's ^3.1.0
range also resolves to 3.2.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@kabaros kabaros changed the title fix(deps): bump @dhis2/multi-calendar-dates to 3.2.0 fix(deps): bump @dhis2/multi-calendar-dates to 3.2.1 Oct 20, 2026
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.

1 participant