Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ semver-governed public surface — a breaking change to a seam is a major bump.

## [Unreleased]

## [0.6.9] - 2026-07-29

### Fixed
- **Dates no longer force US format.** `formatDate` hardcoded the `"en-US"`
locale (and an English short month), so every deployment showed US-style
dates regardless of the viewer. It now formats numeric, day/month per the
configured locale, defaulting to the **viewer's browser locale**. A
deployment can pin it with the new **`setDateLocale(locale)`** (e.g.
`setDateLocale("de-CH")` for `DD.MM.YYYY` everywhere). `setDateLocale` and
`formatDate` are exported from the package.
Note: native `<input type="date">` pickers still render in the browser/OS
locale — that's the platform, not this formatter.

## [0.6.8] - 2026-07-29

### Added
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lambda-development/erp-core",
"version": "0.6.8",
"version": "0.6.9",
"description": "Frontend core of Lambda ERP — app shell, document/master pages, chat UI, reports, and extension registries.",
"license": "Apache-2.0",
"repository": {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export type { ListContext } from "./lib/doc-list-context";
export { configureBranding, getBranding } from "./lib/branding";
export type { Branding } from "./lib/branding";

// Date display locale (default: viewer's browser locale). Pin per deployment,
// e.g. setDateLocale("de-CH").
export { setDateLocale, formatDate } from "./lib/utils";

// API client
export { api, request, ApiError, configureApiBase } from "./api/client";

Expand Down
19 changes: 15 additions & 4 deletions frontend/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,24 @@ export function formatNumber(value: number | null | undefined, decimals = 2) {
}).format(value ?? 0);
}

/** Format a date string for display. */
// Display locale for dates. Default: the viewer's browser locale — the old
// hardcoded "en-US" forced US month/day order (and English month names) on
// every deployment. A deployment can pin it, e.g. setDateLocale("de-CH") for
// DD.MM.YYYY everywhere, regardless of the viewer's browser.
let dateLocale: string | undefined;

/** Pin the locale used by formatDate (undefined = the viewer's browser locale). */
export function setDateLocale(locale: string | undefined) {
dateLocale = locale;
}

/** Format a date string for display (numeric, day-first per the locale). */
export function formatDate(value: string | null | undefined) {
if (!value) return "";
return new Date(value).toLocaleDateString("en-US", {
return new Date(value).toLocaleDateString(dateLocale, {
year: "numeric",
month: "short",
day: "numeric",
month: "2-digit",
day: "2-digit",
});
}

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lambda-erp"
version = "0.6.8"
version = "0.6.9"
description = "Core ERP logic - accounting, sales, purchasing, inventory"
readme = "README.md"
license = "Apache-2.0"
Expand Down