Skip to content

Commit 20d19fe

Browse files
committed
5185: Removed message when instant booking is not available
1 parent a33657d commit 20d19fe

File tree

4 files changed

+22
-31
lines changed

4 files changed

+22
-31
lines changed

build/calendar-config-develop.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"id": "01FRJPF4XATRN8PBZ35XN84PS6",
55
"description": "Mulighed for at vise et kalenderfeed.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/calendar.js?ts=1755602574017",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/calendar-admin.json?ts=1755602574017",
9-
"schema": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/calendar-schema.json?ts=1755602574017",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/calendar.js?ts=1755614741224",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/calendar-admin.json?ts=1755614741224",
9+
"schema": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/calendar-schema.json?ts=1755614741224",
1010
"assets": [],
1111
"options": {},
1212
"content": {}

build/calendar-config-main.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"id": "01FRJPF4XATRN8PBZ35XN84PS6",
55
"description": "Mulighed for at vise et kalenderfeed.",
66
"resources": {
7-
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/calendar.js?ts=1755602574017",
8-
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/calendar-admin.json?ts=1755602574017",
9-
"schema": "https://raw.githubusercontent.com/os2display/display-templates/main/build/calendar-schema.json?ts=1755602574017",
7+
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/calendar.js?ts=1755614741224",
8+
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/calendar-admin.json?ts=1755614741224",
9+
"schema": "https://raw.githubusercontent.com/os2display/display-templates/main/build/calendar-schema.json?ts=1755614741224",
1010
"assets": [],
1111
"options": {},
1212
"content": {}

build/calendar.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/calendar/calendar-single-booking.js

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,10 @@ function CalendarSingleBooking({
224224
);
225225

226226
const futureEvents = calendarEvents.filter(
227-
(el) => !currentEvents.includes(el)
227+
(el) =>
228+
!currentEvents.includes(el) &&
229+
el.endTime > dayjs().unix() &&
230+
el.endTime <= dayjs().endOf("day").unix()
228231
);
229232

230233
const roomInUse = bookingResult !== null || currentEvents.length > 0;
@@ -298,16 +301,17 @@ function CalendarSingleBooking({
298301
</p>
299302
</ContentItem>
300303
)}
301-
{currentEvents.map((event) => (
302-
<ContentItem key={event.id} className="content-item">
303-
<Meta>
304-
{renderTimeOfDayFromUnixTimestamp(event.startTime)}
305-
{" - "}
306-
{renderTimeOfDayFromUnixTimestamp(event.endTime)}
307-
</Meta>
308-
<h1>{getTitle(event.title)}</h1>
309-
</ContentItem>
310-
))}
304+
{!bookingResult &&
305+
currentEvents.map((event) => (
306+
<ContentItem key={event.id} className="content-item">
307+
<Meta>
308+
{renderTimeOfDayFromUnixTimestamp(event.startTime)}
309+
{" - "}
310+
{renderTimeOfDayFromUnixTimestamp(event.endTime)}
311+
</Meta>
312+
<h1>{getTitle(event.title)}</h1>
313+
</ContentItem>
314+
))}
311315
</>
312316
)}
313317
{!roomInUse && (
@@ -342,19 +346,6 @@ function CalendarSingleBooking({
342346
</ButtonWrapper>
343347
</>
344348
)}
345-
{!roomAvailableForInstantBooking && (
346-
<>
347-
<p>
348-
<FormattedMessage
349-
id="instant_booked_not_available"
350-
defaultMessage="Straksbooking ikke tilgængeligt"
351-
/>
352-
</p>
353-
<div style={{ fontSize: ".5em" }}>
354-
{timeCountdownString(secondsUntilNextEvent)}
355-
</div>
356-
</>
357-
)}
358349
</>
359350
)}
360351
{processingBooking && !bookingResult && !bookingError && (

0 commit comments

Comments
 (0)