Skip to contents

create_calendar creates a calendar and stores it in the calendar register for use when calling create_schedule.

Usage

create_calendar(
  holidays = auckland_council_holidays(),
  weekend = c("sunday", "saturday")
)

Arguments

holidays

A vector of Dates which contains the non-working days. By default, this returns a list of non-working days for staff at Auckland Council.

weekend

A character vector of days that are weekends. It accepts: sunday, monday, tuesday, wednesday, thursday, friday, saturday. By default, Saturday and Sunday are assumed to be the days of the weekend.

Examples

# A calendar of non-working days for the first Quarter of 2023, with weekends
# set to the default (Saturdays and Sundays)
q1_2023 <- c(
  seq(as.Date("2023-01-02"), as.Date("2023-01-06"), by = "days"),
  as.Date("2023-01-30"),
  as.Date("2023-02-06")
)
create_calendar(holidays = q1_2023)