Skip to content

Commit

Permalink
Merge pull request #72 from wearefuturegov/staging
Browse files Browse the repository at this point in the history
Production
  • Loading branch information
apricot13 authored Nov 28, 2024
2 parents 90002d0 + b29ae78 commit fe93d2c
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 fe93d2c

Please sign in to comment.