From fbeee08f15e20d1483b2661f84937df463c74cee Mon Sep 17 00:00:00 2001 From: Matthew Harris Date: Fri, 16 Jul 2021 14:31:19 +1000 Subject: [PATCH] setlocale fix in get_met_gdas1 --- R/get_met_gdas1.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/get_met_gdas1.R b/R/get_met_gdas1.R index 04141c0..76a6fc0 100644 --- a/R/get_met_gdas1.R +++ b/R/get_met_gdas1.R @@ -40,12 +40,12 @@ get_met_gdas1 <- function(days, seq(min_date, max_date, by = "1 day") %>% lubridate::day() - # "en_US.UTF-8" is not a valid locale for windows. + # "en_US.UTF-8" is not a valid locale for windows. os_for_locale <- get_os() if(os_for_locale == "win"){ month_names <- seq(min_date, max_date, by = "1 day") %>% - lubridate::month(label = TRUE, abbr = TRUE, locale = Sys.getlocale("LC_TIME")) %>% + lubridate::month(label = TRUE, abbr = TRUE, locale = Sys.setlocale("LC_TIME", "English")) %>% as.character() %>% tolower() } else {