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(); } }