Skip to content

fix: tackle slowness of CalendarInput and Ethiopic calendar failures#1757

Open
kabaros wants to merge 3 commits into
masterfrom
fix/bump-multicalendar
Open

fix: tackle slowness of CalendarInput and Ethiopic calendar failures#1757
kabaros wants to merge 3 commits into
masterfrom
fix/bump-multicalendar

Conversation

@kabaros

@kabaros kabaros commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Bumps @dhis2/multi-calendar-dates to 3.0.0-alpha.1 also:

  • fixes severe typing lag / CI timeouts in CalendarInput (a broken-memoization bug in useDatePicker) - not a breaking change for consumers
  • Un-skips the previously-blocked Ethiopic validation test and adds Jest coverage for gaps (Ethiopic/Nepali widget selection, several untested props, a perf regression suite).
  • Also fixes a real bug found along the way: CalendarInput passed minDate/maxDate to useDatePicker under the wrong key names, so in strict mode the widget kept an out-of-range date selected even though the input correctly rejected it.
  • Types the validation field on CalendarInput's onDateSelect payload, previously undocumented in types/index.d.ts.

The bump to multi-calendar-dates dhis2/multi-calendar-dates#102 bumps it to latest 0.5 and also vendors it to fix the Ethiopic calendar. These changes are breaking in multi-calendar-dates, but none of the changes affect the API of the UI component - useDatePicker consumed signature is unchanged. ⚠️ it might still warrant a breaking change though given the big internal refactor

Fixes:

kabaros and others added 3 commits July 8, 2026 15:30
…lag/CI timeouts

Bumps @dhis2/multi-calendar-dates from 2.1.2 to 3.0.0-alpha.1, which
fixes a broken-memoization bug in useDatePicker causing the year/month
navigation lists and day-cell grid to be fully rebuilt (through Intl)
on every render, including every keystroke while typing (LIBS-763).
Also un-skips the previously-disabled Ethiopic validation test, now
that the CLDR48 era-code bug blocking it is fixed in the same release.

Adds Jest coverage for gaps documented in the new CLAUDE.md: widget-click
day selection for Ethiopic/Nepali, and the format/strictValidation/
pastOnly/dir/numberingSystem/weekDayFormat props, none of which had any
test before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
useDatePicker was receiving validationOptions spread as-is, which is
keyed minDateString/maxDateString for validateDateString's benefit -
useDatePicker itself destructures minDate/maxDate, so it never actually
got the bounds. In strict mode this meant the input correctly rejected
an out-of-range date while the calendar widget still navigated to and
selected it, instead of falling back to today like useDatePicker's own
getInvalidDateResult is meant to for a date it recognizes as invalid.
Warning mode was unaffected since it never triggers that fallback path
regardless.

Adds regression coverage for both the fixed strict-mode case and the
(correct, unaffected) warning-mode case, plus a CLAUDE.md gotcha and a
trim of that file down to durable, agent-facing guidance rather than a
narrative of specific bugs found this session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CalendarInput's onDateSelect payload carries a validation object that
CalendarInput computes itself via multi-calendar-dates' validateDateString
- it was never reflected in this package's own types, since CalendarProps
(and by extension CalendarInputProps) derived onDateSelect structurally
from useDatePicker's bare signature, which knows nothing about it.

Adds CalendarInputValidation (derived from validateDateString's own
return type rather than duplicated by hand) and
CalendarInputOnDateSelectPayload, and overrides onDateSelect on
CalendarInputProps specifically, since the bare Calendar widget never
produces this field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kabaros kabaros requested a review from a team as a code owner July 13, 2026 08:45
@sonarqubecloud

Copy link
Copy Markdown

@kabaros kabaros changed the title Fix/bump multicalendar fix: tackle slowness of CalendarInput and Ethiopic calendar failures Jul 13, 2026
@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-1757--dhis2-ui.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify July 13, 2026 08:49 Inactive
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.

2 participants