Whenever I want one input to depend on another input, I tend to use uiOutput() and renderUI() (the alternative is to use updateXYZInput(), which can be faster, but it's also a little harder to reason about). Here's how you could use these 'generic' UI containers to get the behavior you're looking for:
library(shiny)
ui <- fluidPage(
sliderInput("n", "Day of month", 1, 30, 10),
dateRangeInput("inDateRange", "Input date range", start = Sys.Date(), end = Sys.Date() + 1),
uiOutput("start_date"),
uiOutput("end_date")
)
server <- function(input, output, session) {
observe({
date <- as.Date(paste0("2013-04-", input$n))
updateDateRangeInput(session, "inDateRange",
label = paste("Date range label", input$n),
start = date - 1,
end = date + 1,
min = date - 5,
max = date + 5
)
})
output$start_date <- renderUI({
textInput("start_date_input", "Start date", input$inDateRange[1])
})
output$end_date <- renderUI({
textInput("end_date_input", "End date", input$inDateRange[2])
})
}
shinyApp(ui, server)