Skip to content

Commit

Permalink
fix: convert date even if for POSIXct formats
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Mar 29, 2024
1 parent 60257c9 commit 878516c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/number_of_days.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ number_of_days <- function(date, format = "%Y-%m-%d") {
"characters (e.g. 01), and day 2 characters (e.g. 01)", call. = FALSE)
}

if (is.character(date)) {
if (!inherits(date, "Date")) {
date <- as.Date(date, format = format)
}

Expand Down

0 comments on commit 878516c

Please sign in to comment.