mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 11:55:42 +00:00
giveme git commit message 50 char
This commit is contained in:
@@ -31,6 +31,19 @@ export function paymentDrainMs(): number {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO timestamp of the end of a pay window's drain tail, for client display
|
||||
* (the "payment processing" countdown). Null in ⇒ null out.
|
||||
*/
|
||||
export function paymentDrainEndsAtIso(
|
||||
deadline: Date | string | null | undefined,
|
||||
): string | null {
|
||||
if (deadline == null) return null;
|
||||
const ms = new Date(deadline).getTime();
|
||||
if (!Number.isFinite(ms)) return null;
|
||||
return new Date(ms + paymentDrainMs()).toISOString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A pay window AND its drain tail have closed.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user