New issue
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
Date and DateTime invalid ranges crashes app #158
Comments
See #133 (comment) for example shinyvalidate with these widgets |
Should we consider changing the teal.slice/R/FilterStateDatettime.R Lines 207 to 244 in aab1255
Here's an example where user has to pick an end date greater than start date. This could be along the line when @asbates mentioned about observeEvent today. library(shiny)
ui <- fluidPage(
dateRangeInput("date_range", "Input date range", start = "2001-01-01", end = "2001-02-01")
)
server <- function(input, output, session) {
observeEvent(input$date_range[1], {
end_date = input$date_range[2]
if (input$date_range[2] < input$date_range[1]) {
end_date = input$date_range[1]
}
updateDateRangeInput(session, "date_range",
label = "Date range",
start = input$date_range[1],
end = end_date,
min = input$date_range[1]
)
})
}
shinyApp(ui, server) |
Acceptance Criteria:
|
# Pull Request Fixes #[158](#158) 1. At initialization, when values are not valid, corrections will be performed with warnings. 2. Later, when changed by the user, shinyvalidate is used. Example to test: ``` adsl <- synthetic_cdisc_dataset("latest", "adsl") app <- init( data = teal_data(dataset("ADSL", adsl)), modules = example_module(), filter = list( "ADSL" = list( RANDDT = list(selected = c("2021-02-16", "2021-02-17")), TRT01SDTM = list(selected = c("2021-02-11 17:09:18", "2021-02-10 20:42:27")) ) ) ) runApp(app) ``` --------- Signed-off-by: Marek Blazewicz <110387997+BLAZEWIM@users.noreply.github.com> Co-authored-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com>
From #155 (review)
Change date or date time so that the "from" is after "to":
And the app crashes:
This should be fixed alongside #133 when there is a "save" button to enable validation of filter panel inputs.
Please also add tests
The text was updated successfully, but these errors were encountered: