Skip to content

Commit

Permalink
Automate latest_update()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed Dec 12, 2024
1 parent e4b0d43 commit d7085df
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions R/00-update_refs.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ end_date <- function() {
# Q2 September = 30092024
# Q3 December = 31122024
# Q4 March = 31032024
lubridate::dmy(31122024)
end_date <- lubridate::dmy(31122024)

return(end_date)
}


Expand Down Expand Up @@ -113,7 +115,14 @@ get_dd_period <- function() {
#'
#' @family initialisation
latest_update <- function() {
"Dec_2024"

end_date <- end_date()
month <- as.character(lubridate::month(end_date, label = TRUE))
year <- as.character(lubridate::year(end_date))
latest_update <- as.character(stringr::str_glue('{month}_{year}'))

return(latest_update)

}


Expand Down

0 comments on commit d7085df

Please sign in to comment.