diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-16 11:06:55 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-16 11:13:09 -0300 |
commit | 5d0837913901a2947c66209d64855b324824757d (patch) | |
tree | bff68e1fff6f5833948505849d58f4be4a5e62d1 /packages/taler-util/src/time.ts | |
parent | a66b636dee2ed531bb5119feced80d6569d99176 (diff) |
working on #7357
getTransactionById is introduced:
with that we move all transaction information building into a function
transactionId was added in every response that creates a tx
Diffstat (limited to 'packages/taler-util/src/time.ts')
-rw-r--r-- | packages/taler-util/src/time.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/taler-util/src/time.ts b/packages/taler-util/src/time.ts index 1e79b943b..c3f1b30bd 100644 --- a/packages/taler-util/src/time.ts +++ b/packages/taler-util/src/time.ts @@ -56,6 +56,16 @@ export namespace TalerProtocolTimestamp { t_s: s, }; } + export function min(t1: TalerProtocolTimestamp, t2: TalerProtocolTimestamp): TalerProtocolTimestamp { + if (t1.t_s === "never") { + return { t_s: t2.t_s }; + } + if (t2.t_s === "never") { + return { t_s: t2.t_s }; + } + return { t_s: Math.min(t1.t_s, t2.t_s) }; + } + } export interface Duration { |