Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(web): keep timestamp date and time in the same locale (#7081)
Julius Marminge20a70420a85a
diff --git a/apps/web/src/timestampFormat.test.ts b/apps/web/src/timestampFormat.test.tsindex 1ac2b04a4..f35c1c1fd 100644--- a/apps/web/src/timestampFormat.test.ts+++ b/apps/web/src/timestampFormat.test.ts@@ -176,6 +176,20 @@ describe("formatDayAwareTimestamp", () => {);});+ it("uses the host locale for both the numeric date and wall-clock time", async () => {+ vi.stubGlobal("window", {+ desktopBridge: { getSystemLocale: () => "en-GB" },+ });+ vi.resetModules();++ const { formatDayAwareTimestamp: formatWithHostLocale } = await import("./timestampFormat");+ const messageAt = iso(2026, 7, 12, 15, 44);++ expect(formatWithHostLocale(messageAt, "locale", now)).toBe("12/08 15:44");++ vi.unstubAllGlobals();+ });+it("returns an empty string for invalid input", () => {expect(formatDayAwareTimestamp("not-a-date", "12-hour", now)).toBe("");});diff --git a/apps/web/src/timestampFormat.ts b/apps/web/src/timestampFormat.tsindex 5b57c5316..c1c30a544 100644--- a/apps/web/src/timestampFormat.ts+++ b/apps/web/src/timestampFormat.ts@@ -127,11 +127,11 @@ export function formatShortTimestamp(isoDate: string, timestampFormat: Timestampreturn getTimestampFormatter(timestampFormat, false).format(date);}-const numericDateFormatter = new Intl.DateTimeFormat(undefined, {+const numericDateFormatter = new Intl.DateTimeFormat(timestampLocale, {month: "numeric",day: "numeric",});-const numericDateWithYearFormatter = new Intl.DateTimeFormat(undefined, {+const numericDateWithYearFormatter = new Intl.DateTimeFormat(timestampLocale, {month: "numeric",day: "numeric",year: "numeric",