leesbare tijdseenheid in stats plus timer door laten lopen na einde
This commit is contained in:
@@ -37,35 +37,4 @@ export class FocusService {
|
||||
this.statsSubject.next(this.localStats);
|
||||
}
|
||||
}
|
||||
|
||||
private formatDelta(deltaInMs: number) {
|
||||
const totalSeconds = Math.floor(deltaInMs / 1000);
|
||||
const hours = Math.floor(totalSeconds / 3600);
|
||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
|
||||
const padZero = (num: number) => num.toString().padStart(2, '0');
|
||||
|
||||
return `${padZero(hours)}:${padZero(minutes)}:${padZero(seconds)}`;
|
||||
}
|
||||
|
||||
getFocusCycles(): number {
|
||||
return this.localStats.focusCycles;
|
||||
}
|
||||
|
||||
getFocusTime(): string {
|
||||
return this.formatDelta(this.localStats.focusTimeInMs);
|
||||
}
|
||||
|
||||
getShortBreakCycles(): number {
|
||||
return this.localStats.shortBreakCycles;
|
||||
}
|
||||
|
||||
getLongBreakCycles(): number {
|
||||
return this.localStats.longBreakCycles;
|
||||
}
|
||||
|
||||
getBreakTime(): string {
|
||||
return this.formatDelta(this.localStats.breakTimeInMs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user