Skip to content

Commit

Permalink
support YYYY-MM-DD format in date_to_epiweek
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdefries committed Mar 27, 2024
1 parent a53ad56 commit c51f982
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c51f982

Please sign in to comment.