Skip to content

Commit

Permalink
Merge branch 'master' into documentation-fixes
Browse files Browse the repository at this point in the history
* master:
  Add ability to set global locale in `gt()` (#866)
  Bug fixes and enhancements to date/time formatters (#801)
  • Loading branch information
rich-iannone committed Jan 29, 2022
2 parents 3a9a9b3 + c44578b commit fd10566
Show file tree
Hide file tree
Showing 20 changed files with 1,245 additions and 408 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Expand Up @@ -49,6 +49,7 @@ Suggests:
paletteer,
testthat (>= 2.1.0),
RColorBrewer,
lubridate,
rmarkdown,
rvest,
shiny,
Expand All @@ -72,6 +73,7 @@ Collate:
'dt_groups_rows.R'
'dt_has_built.R'
'dt_heading.R'
'dt_locale.R'
'dt_options.R'
'dt_row_groups.R'
'dt_source_notes.R'
Expand Down
24 changes: 24 additions & 0 deletions R/dt_locale.R
@@ -0,0 +1,24 @@
.dt_locale_key <- "_locale"

dt_locale_get <- function(data) {

dt__get(data, .dt_locale_key)
}

dt_locale_set <- function(data, locale) {

dt__set(data, .dt_locale_key, locale)
}

dt_locale_init <- function(data, locale = NULL) {

list(
locale = locale
) %>%
dt_locale_set(data = data)
}

dt_locale_get_value <- function(data) {

dt_locale_get(data = data)$locale
}

0 comments on commit fd10566

Please sign in to comment.