fix(ui): configurable date locale (was hardcoded en-US) - #13
Closed
jcfrei wants to merge 1 commit into
Closed
Conversation
formatDate forced "en-US" (US month/day order + English month), so every deployment showed US-style dates regardless of the viewer. Now numeric and day/month per a configurable locale, defaulting to the viewer's browser locale; setDateLocale(locale) pins it (e.g. "de-CH" -> DD.MM.YYYY). Both exported. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jcfrei
added a commit
that referenced
this pull request
Jul 29, 2026
fix(ui): configurable date locale, default browser locale (was hardcoded en-US) (#13) formatDate no longer forces US month/day order; numeric + locale-driven, setDateLocale(locale) pins it (e.g. de-CH -> DD.MM.YYYY). setDateLocale + formatDate exported. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Squash-merged into master as 1fbb7a7 and released as v0.6.9. |
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.
Why
formatDatehardcodedtoLocaleDateString("en-US", …), so every deployment rendered US-style dates (month-first, English month) regardless of the viewer — wrong for a Swiss/European ERP.What
formatDatenow formats numeric (day/month2-digit, numeric year) using a configurable locale, defaulting to the viewer's browser locale (no more forced en-US).setDateLocale(locale)pins it per deployment — e.g.setDateLocale("de-CH")→DD.MM.YYYYeverywhere. BothsetDateLocaleandformatDateare now exported from the package.Note
Native
<input type="date">pickers still render in the browser/OS locale — that's the platform, not this formatter. Read-only date displays (lists, reports, tables) are what this fixes.🤖 Generated with Claude Code