diff options
author | Florian Dold <florian@dold.me> | 2021-06-10 16:32:37 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-06-10 16:32:37 +0200 |
commit | 8ad36d89f55783c34043ee9ef37759cd94bcec7c (patch) | |
tree | 1e638b45e59ef50985f799b57590032a57ac7049 /packages/taler-util | |
parent | 7b7e3b4565169835ad04062d5c76ba655abd770a (diff) |
simplify pending transactions, make more tests pass again
Diffstat (limited to 'packages/taler-util')
-rw-r--r-- | packages/taler-util/src/time.ts | 8 |
1 files changed, 8 insertions, 0 deletions
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 "<never>"; + } else { + return new Date(t.t_ms).toISOString(); + } +} + export function timestampIsBetween( t: Timestamp, start: Timestamp, |