Skip to content

Commit 2b37f66

Browse files
committed
Temporal in traces
1 parent db031dc commit 2b37f66

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/storage/db/date-plugin.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
RootOperationNode,
77
UnknownRow,
88
} from "kysely";
9+
import { Temporal } from "@js-temporal/polyfill";
910

1011
import log from "#log";
1112

@@ -38,14 +39,14 @@ function transformRow(row: UnknownRow): UnknownRow {
3839
}
3940

4041
if (sqlitePattern.test(v)) {
41-
log.trace(`Would do: "${v}" -> ${new Date(`${v}Z`)}`);
42-
// res[k] = new Date(v);
42+
log.trace(`Would do: "${v}" -> ${Temporal.Instant.from(`${v}Z`)}`);
43+
// res[k] = Temporal.Instant.from(`${v}Z`);
4344
continue;
4445
}
4546

4647
if (iso8601Pattern.test(v)) {
47-
log.trace(`Would do: "${v}" -> ${new Date(v)}`);
48-
// res[k] = new Date(v);
48+
log.trace(`Would do: "${v}" -> ${Temporal.Instant.from(v)}`);
49+
// res[k] = Temporal.Instant.from(v);
4950
}
5051
}
5152

0 commit comments

Comments
 (0)