Skip to content

fix(ui): configurable date locale (was hardcoded en-US) - #13

Closed
jcfrei wants to merge 1 commit into
masterfrom
fix/date-locale
Closed

fix(ui): configurable date locale (was hardcoded en-US)#13
jcfrei wants to merge 1 commit into
masterfrom
fix/date-locale

Conversation

@jcfrei

@jcfrei jcfrei commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Why

formatDate hardcoded toLocaleDateString("en-US", …), so every deployment rendered US-style dates (month-first, English month) regardless of the viewer — wrong for a Swiss/European ERP.

What

  • formatDate now formats numeric (day/month 2-digit, numeric year) using a configurable locale, defaulting to the viewer's browser locale (no more forced en-US).
  • New setDateLocale(locale) pins it per deployment — e.g. setDateLocale("de-CH")DD.MM.YYYY everywhere. Both setDateLocale and formatDate are 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

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>
@jcfrei

jcfrei commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Squash-merged into master as 1fbb7a7 and released as v0.6.9.

@jcfrei jcfrei closed this Jul 29, 2026
@jcfrei
jcfrei deleted the fix/date-locale branch July 29, 2026 13:50
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