fix: protocol min was returning never
This commit is contained in:
parent
68f3c3b447
commit
26aca142fe
@ -64,10 +64,19 @@ export namespace TalerProtocolTimestamp {
|
|||||||
return { t_s: t2.t_s };
|
return { t_s: t2.t_s };
|
||||||
}
|
}
|
||||||
if (t2.t_s === "never") {
|
if (t2.t_s === "never") {
|
||||||
return { t_s: t2.t_s };
|
return { t_s: t1.t_s };
|
||||||
}
|
}
|
||||||
return { t_s: Math.min(t1.t_s, t2.t_s) };
|
return { t_s: Math.min(t1.t_s, t2.t_s) };
|
||||||
}
|
}
|
||||||
|
export function max(
|
||||||
|
t1: TalerProtocolTimestamp,
|
||||||
|
t2: TalerProtocolTimestamp,
|
||||||
|
): TalerProtocolTimestamp {
|
||||||
|
if (t1.t_s === "never" || t2.t_s === "never") {
|
||||||
|
return { t_s: "never" };
|
||||||
|
}
|
||||||
|
return { t_s: Math.max(t1.t_s, t2.t_s) };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Duration {
|
export interface Duration {
|
||||||
|
Loading…
Reference in New Issue
Block a user