|
|
@ -9,7 +9,7 @@ import {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class ToHMSPipe implements PipeTransform {
|
|
|
|
export class ToHMSPipe implements PipeTransform {
|
|
|
|
|
|
|
|
|
|
|
|
transform(offset: number): string {
|
|
|
|
transform(offset: number, format: string): string {
|
|
|
|
let secs = offset >> 0;
|
|
|
|
let secs = offset >> 0;
|
|
|
|
let seconds = secs % 60;
|
|
|
|
let seconds = secs % 60;
|
|
|
|
let mins = (secs - seconds) / 60 >> 0;
|
|
|
|
let mins = (secs - seconds) / 60 >> 0;
|
|
|
@ -20,6 +20,12 @@ export class ToHMSPipe implements PipeTransform {
|
|
|
|
let m = minutes.toString().padStart(2, '0');
|
|
|
|
let m = minutes.toString().padStart(2, '0');
|
|
|
|
let h = hours.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`;
|
|
|
|
return `${h}h${m}m${s}s`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|