diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-08 17:06:51 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-08 17:06:51 +0200 |
| commit | bd2f982c489b15ce1165c051fdedf35af979f784 (patch) | |
| tree | 5c76d07f94b34f6b7b31be6a133793b2cdaccd79 /src/lib/server/services/references.test.ts | |
| parent | 6d69c7b1e6a8051338e052cc9d1836f4f1a20f51 (diff) | |
Migrate date handling from Date to Temporal API
Routine scheduling, health series, service stamps, session expiry, and
date formatting move to native Temporal (Instant / ZonedDateTime in
UTC), with ISO strings kept at DB and chart boundaries. Ambient types
in src/temporal-ambient.d.ts cover the native runtime; no polyfill.
Observable behavior and stored formats are unchanged.
Diffstat (limited to 'src/lib/server/services/references.test.ts')
| -rw-r--r-- | src/lib/server/services/references.test.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/server/services/references.test.ts b/src/lib/server/services/references.test.ts index 1ec3fdb..49c5c94 100644 --- a/src/lib/server/services/references.test.ts +++ b/src/lib/server/services/references.test.ts @@ -12,7 +12,9 @@ describe('references service', () => { }); it('loadForGrocery returns refs for the given grocery', async () => { - const now = new Date().toISOString(); + const now = Temporal.Now.instant().toString({ + smallestUnit: 'millisecond', + }); const [g1] = await db .insert(groceries) .values({ name: 'coffee', checked: false, createdAt: now }) @@ -33,7 +35,9 @@ describe('references service', () => { }); it('add creates a reference', async () => { - const now = new Date().toISOString(); + const now = Temporal.Now.instant().toString({ + smallestUnit: 'millisecond', + }); const [g] = await db .insert(groceries) .values({ name: 'pasta', checked: false, createdAt: now }) @@ -51,7 +55,9 @@ describe('references service', () => { }); it('deleteReference removes the ref', async () => { - const now = new Date().toISOString(); + const now = Temporal.Now.instant().toString({ + smallestUnit: 'millisecond', + }); const [g] = await db .insert(groceries) .values({ name: 'rice', checked: false, createdAt: now }) |
