Skip to content

Commit

Permalink
Update create-calendar.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjswan authored May 21, 2024
1 parent 0b6509e commit 2b504e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions create-calendar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2b504e4

Please sign in to comment.