feat(settings): add global date and time formats

This commit is contained in:
zipg authored and GitHub committed 2026-07-16 14:49:28 +08:00
1 parent df0415333a
commit 0a1efdcb85
31 files changed
+1109 -88

No files matched your search

@@ -0,0 +1,14 @@
import { describe, expect, it } from "vitest";
import { normalizeSupportedDateTimePattern } from "@/lib/dataGrid/columnFormatter";
describe("normalizeSupportedDateTimePattern", () => {
it("accepts the format grammar shared by the frontend and backend", () => {
expect(normalizeSupportedDateTimePattern(" YYYY/M/D [at] HH:mm:ss.SSSZ ")).toBe("YYYY/M/D [at] HH:mm:ss.SSSZ");
});
it("rejects unsupported or malformed Day.js tokens", () => {
expect(normalizeSupportedDateTimePattern("MM/DD/YYYY hh:mm A")).toBe("");
expect(normalizeSupportedDateTimePattern("YYYY-MM-DD [at HH:mm:ss")).toBe("");
expect(normalizeSupportedDateTimePattern("%Y-%m-%d")).toBe("");
});
});