@devries-cameron20 / t3code-1 / commits / 2c33535780
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): keep timestamp tooltip dates in English (#10256)

Simone committed Sep 6, 2026 at 05:52 UTC 2c3353578098a9e55e203a72217abe993f97987e
2 files changed +20 -1
apps/web/src/timestampFormat.test.ts
+19
@@ -52,6 +52,25 @@ describe("formatShortTimestamp", () => {
52 });
53 });
54
55 +describe("formatChatTimestampTooltip", () => {
56 + afterEach(() => {
57 + vi.restoreAllMocks();
58 + vi.resetModules();
59 + });
60 +
61 + it.each(["de-DE", "it-IT"])("keeps the English date label in a %s runtime", async (locale) => {
62 + const DateTimeFormat = Intl.DateTimeFormat;
63 + vi.spyOn(Intl, "DateTimeFormat").mockImplementation(function (locales, options) {
64 + return new DateTimeFormat(locales ?? locale, options);
65 + });
66 + vi.resetModules();
67 + const { formatChatTimestampTooltip: format } = await import("./timestampFormat");
68 + const date = new Date(2026, 5, 4, 14, 4).toISOString();
69 +
70 + expect(format(date, "24-hour")).toBe("14:04, 4th June 2026");
71 + });
72 +});
73 +
74 describe("formatExpiresInLabel", () => {
75 beforeEach(() => {
76 vi.useFakeTimers();
apps/web/src/timestampFormat.ts
+1 -1
@@ -81,7 +81,7 @@ export function parseTimestampDate(isoDate: string): Date | null {
81 // Deliberately not the host locale: the tooltip's ordinal suffix and
82 // day-before-month order below are English, so a localized month alone would
83 // read "4th Juni 2026". Localizing the whole label is a separate change.
84 -const monthNameFormatter = new Intl.DateTimeFormat(undefined, { month: "long" });
84 +const monthNameFormatter = new Intl.DateTimeFormat("en-US", { month: "long" });
85
86 function ordinalSuffix(day: number): string {
87 const lastTwo = day % 100;