We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae34552 commit 2934db4Copy full SHA for 2934db4
1 file changed
src/ExtensionCodec.ts
@@ -49,6 +49,8 @@ export function encodeDateToTimeSpec(date: Date): TimeSpec {
49
const time = date.getTime();
50
const sec = time < 0 ? Math.ceil(time / 1000) : Math.floor(time / 1000);
51
const nsec = (time - sec * 1000) * 1e6;
52
+
53
+ // Normalizes nsec to ensure it is unsigned.
54
return {
55
sec: sec + Math.floor(nsec / 1e9),
56
nsec: nsec - Math.floor(nsec / 1e9) * 1e9,
0 commit comments