diff --git a/apps/twitch-logs/src/app/comments/comments.component.html b/apps/twitch-logs/src/app/comments/comments.component.html index fc2ab8c..5a37dd5 100644 --- a/apps/twitch-logs/src/app/comments/comments.component.html +++ b/apps/twitch-logs/src/app/comments/comments.component.html @@ -29,9 +29,9 @@ - + - {{comment.offset | tohms}} + {{comment.offset | tohms : 'colons'}} diff --git a/apps/twitch-logs/src/app/pipes/tohms.pipe.ts b/apps/twitch-logs/src/app/pipes/tohms.pipe.ts index 72ac944..bf50c8f 100644 --- a/apps/twitch-logs/src/app/pipes/tohms.pipe.ts +++ b/apps/twitch-logs/src/app/pipes/tohms.pipe.ts @@ -9,7 +9,7 @@ import { }) export class ToHMSPipe implements PipeTransform { - transform(offset: number): string { + transform(offset: number, format: string): string { let secs = offset >> 0; let seconds = secs % 60; let mins = (secs - seconds) / 60 >> 0; @@ -20,6 +20,12 @@ export class ToHMSPipe implements PipeTransform { let m = minutes.toString().padStart(2, '0'); let h = hours.toString().padStart(2, '0'); + if (format == 'colons') { + return `${h}:${m}:${s}`; + } else if (format == 'spaces') { + return `${h}h ${m}m ${s}s`; + } + return `${h}h${m}m${s}s`; } } diff --git a/apps/twitch-logs/src/app/videos/videos.component.html b/apps/twitch-logs/src/app/videos/videos.component.html index 171c940..d2878b1 100644 --- a/apps/twitch-logs/src/app/videos/videos.component.html +++ b/apps/twitch-logs/src/app/videos/videos.component.html @@ -59,7 +59,7 @@ Length - {{video.length | tohms}} + {{video.length | tohms : 'spaces'}}