Adjusted wording and fixed for midnight goal

This commit is contained in:
Maximilian Giller 2024-01-21 22:39:43 +01:00
parent 9ad3ca5a88
commit a909aee7a1

View file

@ -145,7 +145,7 @@
<div id="sleep"></div> <div id="sleep"></div>
<div id="sleep-streak"> <div id="sleep-streak">
Going to bed before 10pm Going to bed before midnight
<br /> <br />
<i id="day-7" class="bi"></i> <i id="day-7" class="bi"></i>
<i id="day-6" class="bi"></i> <i id="day-6" class="bi"></i>
@ -210,18 +210,18 @@
const hours = Math.floor(totalSeconds / 3600); const hours = Math.floor(totalSeconds / 3600);
if (hours > 24) { if (hours > 24) {
return "over a day"; return "Over a day";
} else if (hours > 0) { } else if (hours > 0) {
return hours + " hours remaining"; return "More than " + hours + " hours remaining";
} }
const minutes = Math.floor((totalSeconds - (hours * 3600)) / 60); const minutes = Math.floor((totalSeconds - (hours * 3600)) / 60);
if (minutes > 0) { if (minutes > 0) {
return minutes + " minutes remaining"; return "More than " + minutes + " minutes remaining";
} }
const seconds = totalSeconds - (hours * 3600) - (minutes * 60); const seconds = totalSeconds - (hours * 3600) - (minutes * 60);
return seconds + " seconds remaining"; return "More than " + seconds + " seconds remaining";
} }
function updateStatus() { function updateStatus() {