From c51f982423641a519d34dfb96b3560f66bf3426d Mon Sep 17 00:00:00 2001 From: Nat DeFries <42820733+nmdefries@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:33:48 -0400 Subject: [PATCH] support YYYY-MM-DD format in date_to_epiweek --- R/model.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/model.R b/R/model.R index 90bddd51..383c6ab7 100644 --- a/R/model.R +++ b/R/model.R @@ -239,7 +239,7 @@ parse_data_frame <- function(epidata_call, df, disable_date_parsing = FALSE) { #' @importFrom MMWRweek MMWRweek #' @keywords internal date_to_epiweek <- function(value) { - date_components <- MMWRweek::MMWRweek(as.Date(as.character(value), "%Y%m%d")) + date_components <- MMWRweek::MMWRweek(parse_api_date(value)) as.numeric(paste0( date_components$MMWRyear, # Pad with zeroes up to 2 digits (x -> 0x)