Skip to content

Commit

Permalink
Add lubridate as a dependency to pass a hard check
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Niemeijer committed Oct 16, 2024
1 parent 1e22e35 commit e77e4f8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Imports:
ggplot2,
jsonlite,
lifecycle,
lubridate,
readr,
rlang,
tidyr
Expand Down
7 changes: 0 additions & 7 deletions R/timestamps_to_datetime.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ timestamps_to_datetime <- function(x, tz_offset = NULL, force_tz = NULL) {
out <- as.POSIXct(x, origin = "1970-01-01", tz = "UTC")

if (!is.null(force_tz)) {
if (!requireNamespace("lubridate", quietly = TRUE)) { #nocov start
cli_abort(c(
paste0("Package `lubridate` is needed for this function to work."),
i = paste0("Please install it using `install.packages(\"lubridate\")`"))
)
} #nocov end

out <- lubridate::force_tz(out, tzone = force_tz)
}
out
Expand Down

0 comments on commit e77e4f8

Please sign in to comment.