We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to use updateDateInput where the user is limited to the year selected in a numericInput. I was trying to follow the tutorial here: https://shiny.rstudio.com/reference/shiny/0.14/updateDateInput.html but the demo doesn't seem to be working 😬
Based on this community post I ended up using a delay https://community.rstudio.com/t/updatedateinput-based-on-another-dateinput-issue-in-shiny/55477 and this worked - but I figured the Shiny team may want this on their radar? Thank you!!
library(shiny) library(shinyjs) ui <- fluidPage( useShinyjs(), numericInput("year", "year", value = 2020), dateInput("date", "Date") ) server <- function(input, output, session) { observeEvent(input$year, { req(isTruthy(input$year)) # stop if year is blank daterange <- range(as.Date(paste0(input$year, "-01-01")),as.Date(paste0(input$year, "-12-31"))) updateDateInput(session, "date", min = daterange[1], max = daterange[2] ) delay(250, # delay 250ms updateDateInput(session,"date", value = daterange[1] )) }) } shinyApp(ui = ui, server = server)
The text was updated successfully, but these errors were encountered:
I think even a delay of 0 would work as a hacky workaround. I believe this is most likely a duplicate of #2703
Sorry, something went wrong.
Yes, this is a duplicate of #2703
No branches or pull requests
I want to use updateDateInput where the user is limited to the year selected in a numericInput. I was trying to follow the tutorial here: https://shiny.rstudio.com/reference/shiny/0.14/updateDateInput.html but the demo doesn't seem to be working 😬
Based on this community post I ended up using a delay https://community.rstudio.com/t/updatedateinput-based-on-another-dateinput-issue-in-shiny/55477 and this worked - but I figured the Shiny team may want this on their radar? Thank you!!
This works but seems a little convoluted
The text was updated successfully, but these errors were encountered: