refactor: update timers (#729)

* refactor: remove duplication

* refactor: previous times

* refactor: event patching
This commit is contained in:
Carlos Valente
2024-01-25 13:36:45 +01:00
committed by GitHub
parent e748bff0dd
commit 74e1ae609c
32 changed files with 448 additions and 555 deletions
@@ -52,6 +52,17 @@ export function removeLeadingZero(timer: string): string {
return timer;
}
/**
* Receives a string such as 00:10:10 and removes the seconds field if it is 00
* @param timer
*/
export function removeTrailingZero(timer: string): string {
if (timer.endsWith(':00')) {
return timer.slice(0, -3);
}
return timer;
}
/**
* Receives a string such as 00:10:10 and removes the seconds field
* @param timer