MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / getTimeRemaining

Method getTimeRemaining

src/modals/DeviceCodeModal.ts:385–395  ·  view source on GitHub ↗

* Gets human-readable time remaining

()

Source from the content-addressed store, hash-verified

383 * Gets human-readable time remaining
384 */
385 private getTimeRemaining(): string {
386 const remaining = Math.max(0, this.expiresAt - Date.now());
387 const minutes = Math.floor(remaining / 60000);
388 const seconds = Math.floor((remaining % 60000) / 1000);
389
390 if (minutes > 0) {
391 return this.translate("modals.deviceCode.expiresMinutesSeconds", { minutes, seconds });
392 } else {
393 return this.translate("modals.deviceCode.expiresSeconds", { seconds });
394 }
395 }
396}

Callers 1

onOpenMethod · 0.95

Calls 2

nowMethod · 0.80
translateMethod · 0.65

Tested by

no test coverage detected