MCPcopy
hub / github.com/callumalpass/tasknotes / getActiveElapsedMs

Method getActiveElapsedMs

src/ui/StatusBarService.ts:317–329  ·  view source on GitHub ↗
(task: TaskInfo)

Source from the content-addressed store, hash-verified

315 }
316
317 private getActiveElapsedMs(task: TaskInfo): number {
318 const activeSession = this.plugin.getActiveTimeSession(task);
319 if (!activeSession?.startTime) {
320 return 0;
321 }
322
323 const startMs = Date.parse(activeSession.startTime);
324 if (!Number.isFinite(startMs)) {
325 return 0;
326 }
327
328 return Math.max(0, Date.now() - startMs);
329 }
330
331 private formatElapsedDuration(durationMs: number): string {
332 const totalSeconds = Math.floor(durationMs / 1000);

Callers 1

renderStatusBarMethod · 0.95

Calls 3

getActiveTimeSessionMethod · 0.80
parseMethod · 0.80
nowMethod · 0.80

Tested by

no test coverage detected