Skip to content

Commit

Permalink
fix for uncaught error
Browse files Browse the repository at this point in the history
  • Loading branch information
apricot13 committed Nov 28, 2024
1 parent cb80cac commit be647e6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/lib/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,15 @@ const filters = {
const match = day.match(/(-?\d+)([A-Z]+)/)
return [match[1], match[2]]
})
options = {
bysetpos: bysetpos[0][0],
byweekday: RRule[bysetpos[0][1]],
...options,
const [firstBysetpos] = bysetpos || []
const [position, weekday] = firstBysetpos || []

if (position && weekday) {
options = {
bysetpos: parseInt(position),
byweekday: RRule[weekday],
...options,
}
}
}
}
Expand Down

0 comments on commit be647e6

Please sign in to comment.