minus before time on overtime

This commit is contained in:
Klemek
2024-04-29 22:35:04 +02:00
parent 2210bc808e
commit 57503b251e
+3 -3
View File
@@ -78,12 +78,12 @@ let app = {
}, },
timerText() { timerText() {
const delta = this.timerStarted const delta = this.timerStarted
? Math.floor(Math.abs(this.timerEnd - new Date()) / 1000) ? Math.floor((this.timerEnd - new Date()) / 1000)
: this.showSelected : this.showSelected
? this.selectedData.time * 60 ? this.selectedData.time * 60
: 0; : 0;
return `${String(Math.floor(delta / 60)).padStart(2, "0")}:${String( return `${delta < 0 ? '-' : ''}${String(Math.floor(Math.abs(delta) / 60)).padStart(2, "0")}:${String(
delta % 60 Math.abs(delta) % 60
).padStart(2, "0")}`; ).padStart(2, "0")}`;
}, },
timeText(minutes) { timeText(minutes) {