From 57503b251eaf2c50afdfeff152f741cf2263be9b Mon Sep 17 00:00:00 2001 From: Klemek Date: Mon, 29 Apr 2024 22:35:04 +0200 Subject: [PATCH] minus before time on overtime --- main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 5a7c4bc..88ba1ec 100644 --- a/main.js +++ b/main.js @@ -78,12 +78,12 @@ let app = { }, timerText() { const delta = this.timerStarted - ? Math.floor(Math.abs(this.timerEnd - new Date()) / 1000) + ? Math.floor((this.timerEnd - new Date()) / 1000) : this.showSelected ? this.selectedData.time * 60 : 0; - return `${String(Math.floor(delta / 60)).padStart(2, "0")}:${String( - delta % 60 + return `${delta < 0 ? '-' : ''}${String(Math.floor(Math.abs(delta) / 60)).padStart(2, "0")}:${String( + Math.abs(delta) % 60 ).padStart(2, "0")}`; }, timeText(minutes) {