R/utils-fy_start.R

Defines functions fy_start

Documented in fy_start

#' Beginning of the Fiscal Year
#'
#' Sets the date of some functions to begin at 1st of October.
#'
#' @export
#' @keywords internal
#' @return No return value, called for side effects
fy_start <- function() {
  if (lubridate::month(Sys.Date()) < 10) {
    stats::update(Sys.Date(),
      years = lubridate::year(Sys.Date()) - 1,
      months = 10,
      days = 1
    )
  } else {
    stats::update(Sys.Date(),
      months = 10,
      days = 1
    )
  }
}

Try the tidyndr package in your browser

Any scripts or data that you put into this service are public.

tidyndr documentation built on April 8, 2022, 9:06 a.m.