I'm using 'shiny' in RStudio.
I would like the pre-selected dates of the dateRangeInput widget to be updated with the min and max of a dataset.
When I try the code below (simplified for the start date only), the start date does not show up in the left box of the date range widget: instead, the box appears blank (but it is actually set as today's date - on clicking on the empty box, the calendar with today's date shows up).
ui.r: dateRangeInput("dates", label = "Date range", start='mydatestart', end = '2014-05-06')
The minimum date is actually selected since it shows up when using
ui.r: textOutput('mydatestart')
Here is a reproducible example:
ui.R
library(shiny) shinyUI({ sidebarPanel( dateRangeInput("dates", label = "Date range", start='mydatestart', end = '2014-05-06'), textOutput('mydatestart') ) })
server.R
shinyServer(function(input, output) {
mydate<-c("2013-04-24", "2013-04-25", "2013-04-26", "2013-04-27", "2013-04-28", "2013-04-28", "2013-04-29", "2013-04-30")
output$mydatestart<-renderText(min(mydate))
})
Using output$mydatestart<-renderText(as.Date(min(mydate))) gives the same issue.
Do you know why this is happening?
Thanks,
Yvan