Skip to content

Commit

Permalink
Merge pull request #276 from cmu-delphi/ndefries/date_to_epiweek-gene…
Browse files Browse the repository at this point in the history
…ralize

Support "YYYY-MM-DD" format in `date_to_epiweek`
  • Loading branch information
nmdefries authored Mar 27, 2024
2 parents a53ad56 + 96157f9 commit 626c30b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: epidatr
Type: Package
Title: Client for Delphi's 'Epidata' API
Version: 1.1.4
Version: 1.1.5
Authors@R:
c(
person("Logan", "Brooks", email = "[email protected]", role = c("aut")),
Expand Down
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 626c30b

Please sign in to comment.