From 8ad36d89f55783c34043ee9ef37759cd94bcec7c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 10 Jun 2021 16:32:37 +0200 Subject: simplify pending transactions, make more tests pass again --- packages/taler-util/src/time.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'packages/taler-util') diff --git a/packages/taler-util/src/time.ts b/packages/taler-util/src/time.ts index 980f42db4..c0858ada6 100644 --- a/packages/taler-util/src/time.ts +++ b/packages/taler-util/src/time.ts @@ -217,6 +217,14 @@ export function timestampDifference(t1: Timestamp, t2: Timestamp): Duration { return { d_ms: Math.abs(t1.t_ms - t2.t_ms) }; } +export function timestampToIsoString(t: Timestamp): string { + if (t.t_ms === "never") { + return ""; + } else { + return new Date(t.t_ms).toISOString(); + } +} + export function timestampIsBetween( t: Timestamp, start: Timestamp, -- cgit v1.2.3