Thanks to everyone for chiming in with their input. I realize now that I could have put a better, reproducible example up to help you guys get a better idea of my problem, so sorry about that - I will keep this in mind for future posts (shoutout to @MrFlick for the great link to a post about making one!)
I ended up taking @r2evans comment into account and was able to come up with a solution based off of it! I'm fairly new to Stackoverflow so not sure if I can mark a comment as the answer, but thank you so much @r2evans!
Below was the solution that I used in my server function to help me get the functionality I wanted:
curr_date <- shiny::reactiveValues(start=format(Sys.Date(),"%Y-%m-%d"), end=format(Sys.Date(), "%Y-%m-%d"))
shiny::observeEvent(input$reports_date_range, {
dates <- input$reports_date_range
# if start date changed
if (dates[1] != curr_date$start) {
# if start date is after end date, have end date follow and update curr_date
if(dates[1] > curr_date$end) {
updateDateRangeInput(session, "reports_date_range", start = dates[1], end = dates[1])
curr_date$start <- dates[1]
curr_date$end <- dates[1]
} else { # if start date is equal to or before end date, update curr_date$start
curr_date$start <- dates[1]
}
} else if (dates[2] != curr_date$end) { # if end date changed
# if end date is before start date, have start date follow end date
if(dates[2] < curr_date$start) {
updateDateRangeInput(session, "reports_date_range", start = dates[2], end = dates[2])
curr_date$start <- dates[2]
curr_date$end <- dates[2]
} else { # if end date is equal to or after the start date, update curr_date$end
curr_date$end <- dates[2]
}
}
})
Basically, the reactive values in curr_date
hold the current date the inputs are defaulted to at the beginning, and are updated to what the inputs become every time they are changed.
In the server logic, I check if there is a mismatch between the date inputted by the user, and the historic value I have for the input in curr_date
to figure out which of the two dates (start or end) were changed by the user. Then, it's a simple matter of applying the correct code based on what the user did!
Thank you once again everyone and let me know if there is anything you guys can spot to make this solution better, I will update if there are any findings!