on_earth_day <- yearly() %>%
  recur_on_month_of_year("April") %>%
  recur_on_day_of_month(22) %>%
  rholiday("Earth Day")
cal <- rcalendar(
  hol_christmas(),
  on_earth_day,
  hol_us_independence_day()
)
cal
cal_events(cal, year = 2020:2022)
# Lookup holiday name based on date, if it exists
cal_match(c("2021-12-25", "2021-12-26"), cal)
# Find next holiday
alma_next("2021-12-26", cal)
Run the code above in your browser using DataLab