Skip to content

Commit

Permalink
Merge pull request #276 from rstudio/bugfix/windows-lc-time
Browse files Browse the repository at this point in the history
Use "English" for LC_TIME on windows
  • Loading branch information
jjallaire authored Dec 31, 2020
2 parents 1eefa0d + 4c859a9 commit cc20d87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cc20d87

Please sign in to comment.