fix(vendor): remove this-param from DateTimeFormatImpl to fix Babel arg-shift bug#100
Merged
Conversation
…rg-shift bug Babel's parameter-transform plugin counts the TypeScript-only `this` parameter as real when compiling DateTimeFormatImpl's default-valued params for older targets, shifting locale/optionsParam into arguments[1]/[2] instead of [0]/[1]. This silently broke every toLocaleString() call, causing date-only formatting (e.g. calendar day cells) to render as a full date instead of just the requested field. src/vendor is excluded from tsconfig.json type-checking, so the `this` type isn't needed for compilation; the runtime value is unaffected since `this` is still bound dynamically by the `new` call site. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
KaiVandivier
approved these changes
Jul 3, 2026
dhis2-bot
added a commit
that referenced
this pull request
Jul 3, 2026
# [2.2.0-alpha.2](v2.2.0-alpha.1...v2.2.0-alpha.2) (2026-07-03) ### Bug Fixes * **vendor:** remove this-param from DateTimeFormatImpl to fix Babel arg-shift bug ([#100](#100)) ([23e7553](23e7553))
Contributor
|
🎉 This PR is included in version 2.2.0-alpha.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This bug was caught after integrating with UI library, as .toLocaleString stopped calling the underlying i18n object breaking some date formatting there
Babel's parameter-transform plugin counts the TypeScript-only
thisparameter as real when compiling DateTimeFormatImpl's default-valued params for older targets, shifting locale/optionsParam into arguments[1]/[2] instead of [0]/[1]. This silently broke every toLocaleString() call, causing date-only formatting (e.g. calendar day cells) to render as a full date instead of just the requested field.src/vendor is excluded from tsconfig.json type-checking, so the
thistype isn't needed for compilation; the runtime value is unaffected sincethisis still bound dynamically by thenewcall site.