I want to add a slideInput with multiple fixed values into my Shiny app to show the measurement date of my experiment. The interval of date is random.
This is my testing codes to want to show four dates in sliderInput.
library(shiny)
values <- as.Date(c('2015-1-1, 2015-6-20', '2015-7-2', '2016-1-1'))
ui <- shinyUI(bootstrapPage(
headerPanel("test"),
sliderInput("foo", "Animation duration",
min = as.Date('2015-1-1'),
max = as.Date('2016-1-1'),
value = values,
timeFormat = '%d/%m/%Y')
))
server <- shinyServer(function(input, output, session) {
})
shinyApp(ui = ui, server = server)
The values also can be updated in the server.R
.
selectInput
could be another option, but I prefer to use sliderInput
which do make sense for date.
I guess I have to manipulate some js scripts, but have no experience about it.
Thanks for any suggestions to implement it.