set_formatter_datetime | R Documentation |
Set datetime formatter
set_formatter_datetime(
widget,
column,
input_format = "yyyy-MM-dd hh:ss:mm",
output_format = "yy/MM/dd",
invalid_placeholder = "(invalid datetime)",
timezone = NA,
hoz_align = "left"
)
widget |
A |
column |
The name of the column the formatter is applied to. |
input_format |
(character): The datetime input format. |
output_format |
(character): The datetime output format. |
invalid_placeholder |
(character): The value to be displayed if an invalid datetime is provided. |
timezone |
(character): The timezone of the datetime. |
hoz_align |
(character): The horizontal alignment of the column. |
To use this formatter, you need to include
the luxon HTML dependency with tabulator(..., luxon = TRUE)
.
The updated tabulator()
HTML widget
data <- data.frame(
Person = c("Franz", "Ferdinand"),
Birthday = c(
"2024-12-06 22:00:10",
"2023-06-07 14:12:45"
)
)
tabulator(data, luxon = TRUE) |>
set_formatter_datetime("Birthday", output_format = "dd.MM.yyyy")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.