updateTimeInput | R Documentation |
Change the label and/or value of a time input
updateTimeInput(session, inputId, label = NULL, value = NULL)
session |
The |
inputId |
The id of the input object. |
label |
The label to set for the input object. |
value |
The desired time value. Must be a instance of |
Other shinyTime functions:
shinyTimeExample()
,
timeInput()
## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
timeInput("time", "Time:"),
actionButton("to_current_time", "Current time")
)
server <- function(input, output, session) {
observeEvent(input$to_current_time, {
updateTimeInput(session, "time", value = Sys.time())
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.