Test to check if a date, or intervals is within a given
financial year.
If given just one date it will check to see if it is in the
given financial year.
When supplied with two dates it will check to see if
any part of that date range falls in the given financial year. If the
date_end is NA it checks that date was before or during the financial
year.
Usage
is_date_in_fyyear(fyyear, date, date_end = NULL)
Arguments
- fyyear
The financial year in the format '1718' as a character
- date
The main/start date to check
- date_end
(optional) The end date
Value
a logical, TRUE/FALSE
See also
Other date functions:
calculate_stay(),
compute_mid_year_age(),
convert_date_to_numeric(),
convert_numeric_to_date(),
end_fy(),
end_fy_quarter(),
end_next_fy_quarter(),
fy_interval(),
last_date_month(),
midpoint_fy(),
next_fy(),
start_fy(),
start_fy_quarter(),
start_next_fy_quarter()
Examples
is_date_in_fyyear("2223", Sys.time())
#> [1] FALSE
is_date_in_fyyear(
fyyear = "2122",
date = as.Date("2020-01-01"),
date_end = as.Date("2023-01-01")
)
#> [1] TRUE