Im trying to get some date ranges from a calendar input. These dates need to be formatted as text like this:
If user picks May 6 / 1986 from the calendar, i will require 19860506 so i can use this text string on other calculations.
This is a basic example of what i have so far but Im not getting the desired result
UI
ui <- fluidPage(
airDatepickerInput(
inputId = "range",
label = "Select range of dates:",
range = TRUE,
value = c(Sys.Date()-7,
Sys.Date()),
todayButton = F,
clearButton = T,
addon = c("none")
) )
Server
server <- function(input, output, session) {
date_start <- as.character(as.Date(input$range[1], format="%Y%m%d"))
date_end <- as.character(as.Date(input$range[2], format="%Y%m%d"))
##Visualization check
output$date1 <- renderPrint(date_start)
output$date2 <- renderPrint(date_end)
}