From c1fa1a4a5f9333ec5aea06558073e6bf31dc5a46 Mon Sep 17 00:00:00 2001 From: Paul Fournier Date: Mon, 30 Oct 2023 01:03:05 +0100 Subject: [PATCH] removed midnight border, added back hour number --- www/css/calendar.css | 21 +++------------------ www/js/calendar.js | 21 +++------------------ 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/www/css/calendar.css b/www/css/calendar.css index 8e91a09..e192aca 100644 --- a/www/css/calendar.css +++ b/www/css/calendar.css @@ -30,7 +30,7 @@ width: 100%; height: calc(100% + 30px); padding: 0; - border-bottom: 2px solid rgba(71, 19, 43, 0.25); + border-bottom: 0px solid rgba(71, 19, 43, 0.25); z-index: 10; } @@ -58,8 +58,8 @@ #cal-container .cal-time-slot-hour { padding: 0 0 0 calc(100% - 0.9rem + 7px); background-color: none; /* rgba(255, 223, 165, 0.08); */ - border-bottom: 2px solid rgba(71, 19, 43, 0.25); - font-size: 0.9rem; + border-bottom: 0px solid rgba(71, 19, 43, 0.25); + font-size: 1rem; } #cal-container .cal-time-slot-hour:nth-child(even) { @@ -71,21 +71,6 @@ border-right: 0; } -#cal-container .cal-time-slot-hour.cal-last-hour { - padding: 0; - color: transparent; -} - -#cal-container .cal-time-slot.cal-last-hour, -#cal-container .cal-time-slot-hour.cal-last-hour { - border-right: 1px solid rgba(71, 19, 43, 0.25); -} - -#cal-container .cal-time-slot.cal-first-hour, -#cal-container .cal-time-slot-hour.cal-first-hour { - border-left: 1px solid rgba(71, 19, 43, 0.25); -} - /* Events */ #cal-container .cal-event-container { diff --git a/www/js/calendar.js b/www/js/calendar.js index b7687c6..70117b5 100644 --- a/www/js/calendar.js +++ b/www/js/calendar.js @@ -236,14 +236,9 @@ class Calendar { createTimeSlots () { // Populate the container hour by hour let self = this; - function getHourStringToDisplay (index, hour) { - if (index === self.nbHoursToDisplay - 1 - || hour === 23) { - return ""; - } - + function getHourStringToDisplay (hour) { if (hour >= 10) { - return hour + 1; + return (hour + 1) % 24; } else { return " " + (hour + 1); @@ -262,7 +257,7 @@ class Calendar { "grid-row-start" : "1", "grid-row-end" : "1" }) - .html(getHourStringToDisplay(i, hour)) + .html(getHourStringToDisplay(hour)) .prependTo(this.timeSlotsContainerNode); // Time slot block @@ -275,16 +270,6 @@ class Calendar { "grid-row-end" : "2" }) .appendTo(this.timeSlotsContainerNode); - - if (hour === 23) { - timeSlotHourNode.addClass("cal-last-hour"); - timeSlotBlockNode.addClass("cal-last-hour"); - } - - if (hour === 0) { - timeSlotHourNode.addClass("cal-first-hour"); - timeSlotBlockNode.addClass("cal-first-hour"); - } } }