I want to add a date selection input.
Right now I am using dateInput, but I found that it contains all the dates, what I want to achieve is to show only the dates that exist in the date column of my data, I tried to use datesdisabled , but it doesn't seem to work well.
Why not?
All you need to do is to define the total used range, and then the allowed dates and the dates to exclude are simply all the possible dates without the allowed ones.
## very trivial example for the range should be realised with true date-ranges!
Jan = paste("2023-01", 1:31, sep = "-")
# define the available dates
available = c("2023-01-11",
"2023-01-12",
"2023-01-15",
"2023-01-22",
"2023-01-27",
"2023-01-28")
# remove the available ones from the list
not_available = Jan[!Jan %in% available]
not_available
[1] "2023-01-1" "2023-01-2" "2023-01-3" "2023-01-4" "2023-01-5" "2023-01-6" "2023-01-7" "2023-01-8"
[9] "2023-01-9" "2023-01-10" "2023-01-13" "2023-01-14" "2023-01-16" "2023-01-17" "2023-01-18" "2023-01-19"
[17] "2023-01-20" "2023-01-21" "2023-01-23" "2023-01-24" "2023-01-25" "2023-01-26" "2023-01-29" "2023-01-30"
[25] "2023-01-31"