From c444e27d0de690e35cf242acd8bc8b643ad53f53 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 14 Oct 2024 10:34:01 +0200 Subject: [PATCH] adds more styling and fixes little bug in the currentHour Stundenplan indicator --- public/js/components/Calendar/Week/Page.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/js/components/Calendar/Week/Page.js b/public/js/components/Calendar/Week/Page.js index 10c56e13e..1733118cd 100755 --- a/public/js/components/Calendar/Week/Page.js +++ b/public/js/components/Calendar/Week/Page.js @@ -98,6 +98,11 @@ export default { let minutePercentage = currentMinutes % currentHour; // calculate minutes from float part of time let minute = Math.round(60 * minutePercentage); + // in case the rounding made the minutes 60, increase the hour and reset the minutes + if(minute == 60){ + currentHour++; + minute = 0; + } // add padding to minutes that consist of only one digit minute.toString().length == 1 ? minute = "0" + minute : minute; this.hourPositionTime = currentHour + ":" + minute; @@ -130,9 +135,11 @@ export default { {{day.toLocaleString(undefined, [{day:'numeric',month:'numeric'},{day:'numeric',month:'numeric'},{day:'numeric',month:'numeric'},{dateStyle:'short'}][this.size])}} -
+
-
{{hourPositionTime}}
+
+ {{hourPositionTime}} +
{{hour}}:00