# Make a rrule for weekends
on_weekends <- weekly() %>%
recur_on_weekends()
# "Step forward by 2 business days"
# 2019-09-13 is a Friday.
# Here we:
# - Step 1 day to Saturday
# - Adjust to Monday
# - Step 1 day to Tuesday
alma_step("2019-09-13", 2, on_weekends)
# If Monday, 2019-09-16, was a recurring holiday, we could create
# a custom runion and step over that too.
on_09_16 <- yearly() %>%
recur_on_month_of_year(9) %>%
recur_on_day_of_month(16)
rb <- runion(on_09_16, on_weekends)
alma_step("2019-09-13", 2, rb)
Run the code above in your browser using DataLab