We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I create the mydown package as in the example, and then use the template without any editing, I'm getting an R code warning printed at the top
mydown
sessionInfo() R version 4.0.4 (2021-02-15) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042) Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_4.0.4 fastmap_1.1.0 mydown_0.1 htmltools_0.5.2 tools_4.0.4 yaml_2.2.1 rmarkdown_2.11 knitr_1.36 [9] xfun_0.23 digest_0.6.27 rlang_0.4.10 evaluate_0.14
The text was updated successfully, but these errors were encountered:
Thanks for the report. This looks like a problem that would only occur on Windows.
We need to think more about the mapping language to locale in a platform-independent way.
Can you please tweak the generated cd_format_date() function to use a supported locale, e.g. "English_United States.1252" ?
cd_format_date()
"English_United States.1252"
Sorry, something went wrong.
I think cd_format_date() should not rely on the system, but instead do something as discussed in #12.
@krlmlr changing "en_US" to "English_United States.1252" removed the warning for me on Windows.
"en_US"
cd_format_date <- function(date, lang = default(rmarkdown::metadata$lang, "en-US")) { date <- as.Date(date) if (lang %in% c("german", "de-DE", "de-CH")) { withr::with_locale(c("LC_TIME" = "de_DE"), format(date, "%e. %B %Y")) } else { withr::with_locale(c("LC_TIME" = "English_United States.1252"), format(date, "%B %e, %Y")) } }
No branches or pull requests
When I create the
mydown
package as in the example, and then use the template without any editing, I'm getting an R code warning printed at the topThe text was updated successfully, but these errors were encountered: