Shiny offers a convenient date picker input feature:
ui <- fluidPage(
dateInput("date1", "Date:", value = "2012-02-29"),
# The default value is set to the client's time zone
dateInput("date2", "Date:"),
# Even if the display format differs, the value remains yyyy-mm-dd
dateInput("date3", "Date:", value = "2012-02-29", format = "mm/dd/yy"),
# Input expects a Date object
dateInput("date4", "Date:", value = Sys.Date()-10),
# Supporting different languages and first day of the week variations
dateInput("date5", "Date:",
language = "ru",
weekstart = 1),
# Customizing view to start with decade instead of month
dateInput("date6", "Date:",
startview = "decade")
)
shinyApp(ui, server = function(input, output) { })
Demo:
If this isn't sufficient, users can create their own custom input objects: