From 8b811f11c95621901ad7af2a1f911d5fd46277a8 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sun, 18 Aug 2024 13:08:52 +0200 Subject: [PATCH] Test fixes --- plug-api/lib/json.test.ts | 5 +---- plug-api/lib/json.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plug-api/lib/json.test.ts b/plug-api/lib/json.test.ts index 7127164b..d0969ab7 100644 --- a/plug-api/lib/json.test.ts +++ b/plug-api/lib/json.test.ts @@ -22,9 +22,6 @@ Deno.test("JSON utils", () => { assertEquals(cleanupJSON({ a: [{ "a.b": 1 }] }), { a: [{ a: { b: 1 } }], }); - assertEquals( - cleanupJSON(new Date("2023-05-13T12:30:00Z")), - "2023-05-13T12:30:00.000Z", - ); + assertEquals(cleanupJSON(new Date("2023-05-03T00:00:00Z")), "2023-05-03"); }); diff --git a/plug-api/lib/json.ts b/plug-api/lib/json.ts index f26b7000..dd2b5cf4 100644 --- a/plug-api/lib/json.ts +++ b/plug-api/lib/json.ts @@ -60,7 +60,7 @@ export function cleanStringDate(d: Date): string { String(d.getMonth() + 1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0"); } else { - return localDateString(d); + return d.toISOString(); } }