## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
sliderInput("controller", "Controller", 1, 30, 10),
dateInput("inDate", "Input date")
)
server <- function(input, output, session) {
observe({
# We'll use the input$controller variable multiple times, so save it as x
# for convenience.
x <- input$controller
updateDateInput(session, "inDate",
label = paste("Date label", x),
value = paste("2013-04-", x, sep=""),
min = paste("2013-04-", x-1, sep=""),
max = paste("2013-04-", x+1, sep="")
)
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab