Skip to content

Support "YYYY-MM-DD" format in date_to_epiweek #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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