Skip to content

Commit 626c30b

Browse files
authored
Merge pull request #276 from cmu-delphi/ndefries/date_to_epiweek-generalize
Support "YYYY-MM-DD" format in `date_to_epiweek`
2 parents a53ad56 + 96157f9 commit 626c30b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: epidatr
22
Type: Package
33
Title: Client for Delphi's 'Epidata' API
4-
Version: 1.1.4
4+
Version: 1.1.5
55
Authors@R:
66
c(
77
person("Logan", "Brooks", email = "[email protected]", role = c("aut")),

R/model.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ parse_data_frame <- function(epidata_call, df, disable_date_parsing = FALSE) {
239239
#' @importFrom MMWRweek MMWRweek
240240
#' @keywords internal
241241
date_to_epiweek <- function(value) {
242-
date_components <- MMWRweek::MMWRweek(as.Date(as.character(value), "%Y%m%d"))
242+
date_components <- MMWRweek::MMWRweek(parse_api_date(value))
243243
as.numeric(paste0(
244244
date_components$MMWRyear,
245245
# Pad with zeroes up to 2 digits (x -> 0x)

0 commit comments

Comments
 (0)