mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 20:33:47 +00:00
refactor: update timers (#729)
* refactor: remove duplication * refactor: previous times * refactor: event patching
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user