From 2b504e48e327b84a1a4f638dc95bec4308a1bb17 Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Tue, 21 May 2024 19:29:24 +0300 Subject: [PATCH] Update create-calendar.mjs --- create-calendar.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/create-calendar.mjs b/create-calendar.mjs index 7bf1240..d24f346 100644 --- a/create-calendar.mjs +++ b/create-calendar.mjs @@ -30,21 +30,21 @@ export default function createCalendar(raw, name) for (let i = 0; i < hours.length;) { - const hour = hours[i] - const start = day.plus({hours: Number(hour) - 1}) const status = dayScedule[hour] - if (status == "yes") { + i++; continue; } + const hour = hours[i] + const start = day.plus({hours: Number(hour) - 1}) while (dayScedule[hours[i]] === status) { i++ } - const end = day.plus({hours: Number(hours[i] ? hours[i] : 25) - 1}) + cal.createEvent({ start, end,