Description Usage Arguments Value Author(s) Examples
time_input creates a time input field for correctly formatted time values
update_time_input changes the value/label or placeholder of an time input element on the client side.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
id |
id of the element |
label |
label to show for the input, NULL for no label |
value |
initial value |
min |
minimum time value, must follow the specified format, e.g. "08:00" |
max |
maximum time value, must follow the specified format, e.g. "17:00" |
format |
format to use for the time string, can be any valid moment.js time format (NOTE: this will only work with the material time picker and can't be updated!) |
placeholder |
optional character specifying the placeholder text |
width |
optional, the width of the input, see
|
color |
color of the watch hand (of material time picker) |
use_material_picker |
boolean to specify if the input should be a simple time (text) input or use the bootstrap material time picker |
session |
the shiny session object |
time_input: shiny input element
update_time_input: message to the client
richard.kunze
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
fluidRow(
column(3,
time_input("time1", "Simple:", value = "12:34"),
time_input("time2", "Fancy:", use_material_picker = TRUE),
actionButton("update", "Update")
)
)
),
server = function(input, output, session) {
observeEvent(input$update, {
update_time_input(session, "time2", value = "12:34")
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.