diff --git a/R/utils-date_time_parse.R b/R/utils-date_time_parse.R index 619945e..6e19a53 100644 --- a/R/utils-date_time_parse.R +++ b/R/utils-date_time_parse.R @@ -121,7 +121,7 @@ long_tzid_to_tz_str <- function(long_tzid, input_dt) { tzdb$zone_name == long_tzid, c("date_start", "gmt_offset_h")] if (nrow(tzdb_entries_tzid) == 0L) { - return(NA_character_) + return(NULL) } input_date <- as.Date(input_dt) diff --git a/tests/testthat/test-fdf_ftf.R b/tests/testthat/test-fdf_ftf.R index 1efc8e8..c44854a 100644 --- a/tests/testthat/test-fdf_ftf.R +++ b/tests/testthat/test-fdf_ftf.R @@ -196,8 +196,24 @@ test_that("`flex_*_lst` can be used in `fdt()`", { test_that("fdt() works in all contexts", { expect_equal( - bigD::fdt("2024-03-01", format = "GyMMMEd", use_tz = "America/Toronto"), + fdt("2024-03-01", format = "GyMMMEd", use_tz = "America/Toronto"), "AD2024MarFri1" ) - + # Copy of a test in gt + expect_equal( + fdt(as.POSIXlt( + c( + "1970-01-01 15:35:00", "1970-01-01 16:36:00", "1970-01-01 17:37:00", + "1970-01-01 18:38:00", "1970-01-01 19:39:00" + ), + tz = "GMT" + ), + format = "EBhms" + ), + c( + "Thu 3:35:00 in the afternoon", "Thu 4:36:00 in the afternoon", + "Thu 5:37:00 in the afternoon", "Thu 6:38:00 in the evening", + "Thu 7:39:00 in the evening" + ) + ) })