Skip to contents

almanac 1.0.0

CRAN release: 2023-04-13

New features

  • New holiday and calendar API and corresponding vignette vignette("holidays-calendars") (#96):

    • rholiday() creates a new holiday from a holiday name and a rschedule that defines when the holiday occurs. There are a number of pre-created holidays prefixed with hol_*(), such as hol_christmas() and hol_us_thanksgiving(). Holidays are rschedules, so you can use all of the alma_*() functions on them.

    • hol_observe(), hol_offset(), and hol_rename() are three helpers for the holiday API. In particular, hol_observe() tweaks a holiday’s observance date to align with when your business actually celebrated that holiday.

    • rcalendar() bundles multiple holidays together into a calendar. Calendars are similar to runion()s, so you can use all the alma_*() functions on these, but they also come with their own specialized API of functions that start with cal_*(), such as cal_match() to look up the holiday name a date corresponds to, and cal_events() to filter for all of the holidays within a particular year.

    • cal_us_federal() is an example calendar representing the federal holidays recognized in the United States.

  • New roffset() for creating an rschedule with events that are offset from an existing rschedule (#94).

  • New rcustom() for creating an rschedule from manually defined event dates (#90).

  • alma_events() has gained a year argument to limit the returned set of events to specific years.

  • runion(), rintersect(), and rsetdiff() have all gained ... which allows you to provide rschedules at creation time. This is now the preferred way to create these set-based rschedules (#91).

  • Steppers created with stepper() now work as .before and .after arguments of slider::slide_index() and friends (#80).

Lifecycle changes

Breaking changes

  • All almanac class names are now prefixed with almanac_* to avoid potential clashes with other packages.

  • The recur_with_week_start() argument wday has been renamed to day.

  • The following developer facing functions have been removed because they are either no longer applicable or provided extension mechanisms that are not very useful in practice (#93):

    • new_rbundle()
    • new_runion()
    • new_rintersect()
    • new_rsetdiff()
    • rbundle_restore()

Bug fixes and minor improvements

  • recur_for_count() no longer overrides until (#95).

  • New almanac_since() and almanac_until() helpers to access the default since and until values used for all rules (#95).

  • Greatly improved the print methods of all almanac classes using cli (#86).

  • Updated internal JavaScript rrule library to version 2.7.2 (#82).

  • R >=3.5.0 is now required, which is in line with tidyverse standards.

almanac 0.1.1

CRAN release: 2020-05-28

  • Explicitly imports R6::R6Class() and V8::v8() to avoid R CMD Check false alarms (#74).

  • Fix USBAN error of casting NA_real_ and NaN to integer (#72).

almanac 0.1.0

CRAN release: 2020-05-27

  • Added a file to track changes to the package.