fix(oracle): preserve DATE time in display and export

This commit is contained in:
zipg authored and GitHub committed 2026-07-09 15:04:34 +08:00
1 parent aa0abcd670
commit ce8cb2b509
17 files changed
+504 -58

No files matched your search

@@ -0,0 +1,34 @@
import { describe, expect, it } from "vitest";
import { dataGridCellDisplayText } from "@/lib/dataGrid/dataGridCellCoercion";
describe("dataGridCellDisplayText", () => {
it("formats Oracle DATE values without RFC3339 separators", () => {
expect(
dataGridCellDisplayText({
value: "2022-08-25T09:58:43Z",
databaseType: "oracle",
columnInfo: { data_type: "DATE" },
}),
).toBe("2022-08-25 09:58:43");
});
it("formats midnight Oracle DATE values as a date", () => {
expect(
dataGridCellDisplayText({
value: "2022-08-25T00:00:00Z",
databaseType: "oracle",
columnInfo: { data_type: "DATE" },
}),
).toBe("2022-08-25");
});
it("does not format non-date Oracle strings", () => {
expect(
dataGridCellDisplayText({
value: "2022-08-25T09:58:43Z",
databaseType: "oracle",
columnInfo: { data_type: "VARCHAR2(64)" },
}),
).toBeUndefined();
});
});