Allow to edit content of columns with a calendar and time picker,
then retrieve value server-side in shiny application with input$<outputId>_data
.
Arguments
- grid
A table created with
datagrid()
.- column
Column for which to activate the date picker.
- format
Date format, default is
"yyyy-MM-dd"
.- type
Type of selection: date, month or year.
- timepicker
Add a timepicker.
See also
grid_editor
for normal inputs.
Examples
library(toastui)
dat <- data.frame(
date = Sys.Date() + 1:10,
month = format(Sys.Date() + 1:10, format = "%Y-%m"),
year = format(Sys.Date() + 1:10, format = "%Y"),
time1 = Sys.time() + 1:10,
time2 = Sys.time() + 1:10
)
datagrid(dat) %>%
grid_editor_date(
column = "date"
) %>%
grid_editor_date(
column = "month",
type = "month",
format = "yyyy-MM"
) %>%
grid_editor_date(
column = "year",
type = "year",
format = "yyyy"
) %>%
grid_editor_date(
column = "time1",
timepicker = "tab",
format = "yyyy-MM-dd HH:mm"
) %>%
grid_editor_date(
column = "time2",
timepicker = "normal",
format = "yyyy-MM-dd HH:mm"
)