From 4c859a91f2448719728f919ec6a46b8e17decb47 Mon Sep 17 00:00:00 2001 From: JJ Allaire Date: Thu, 31 Dec 2020 10:54:37 -0500 Subject: [PATCH] use "English" for LC_TIME on windows --- R/utils.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index d0b07535..178a72ec 100644 --- a/R/utils.R +++ b/R/utils.R @@ -118,7 +118,7 @@ date_today <- function() { date_as_rfc_2822 <- function(date) { date <- as.Date(date, tz = "UTC") with_locale( - new = c("LC_TIME" = "en_US.UTF-8"), + new = c("LC_TIME" = ifelse(is_windows(), "English", "en_US.UTF-8")), as.character(date, format = "%a, %d %b %Y %H:%M:%S %z", tz = "UTC") ) } @@ -252,6 +252,10 @@ is_osx <- function() { Sys.info()["sysname"] == "Darwin" } +is_windows <- function() { + .Platform$OS.type == "windows" +} + # function for resolving resources distill_resource <- function(name) { system.file("rmarkdown/templates/distill_article/resources", name,