Those functions allow to navigate in the calendar from the server in a Shiny application.
Usage
cal_proxy_next(proxy)
cal_proxy_prev(proxy)
cal_proxy_today(proxy)
cal_proxy_date(proxy, date)
Arguments
- proxy
A
calendar_proxy()
htmlwidget
object.- date
A specific date to navigate to.
See also
Other calendar proxy methods:
cal_proxy_clear()
,
cal_proxy_clear_selection()
,
cal_proxy_options()
,
cal_proxy_toggle()
,
cal_proxy_view()
,
calendar-proxy-schedule
,
calendar_proxy()
Examples
library(shiny)
library(toastui)
ui <- fluidPage(
tags$h2("Navigate in calendar with actionButtons"),
actionButton(
inputId = "prev_date",
label = "Previous",
icon = icon("chevron-left")
),
actionButton(
inputId = "next_date",
label = "Next",
icon = icon("chevron-right")
),
actionButton(
inputId = "today",
label = "Today"
),
fluidRow(
column(
width = 9,
calendarOutput(outputId = "my_calendar")
),
column(
width = 3,
verbatimTextOutput("result")
)
)
)
server <- function(input, output, session) {
output$my_calendar <- renderCalendar({
calendar()
})
output$result <- renderPrint({
input$my_calendar_dates
})
observeEvent(input$prev_date, cal_proxy_prev("my_calendar"))
observeEvent(input$next_date, cal_proxy_next("my_calendar"))
observeEvent(input$today, cal_proxy_today("my_calendar"))
}
if (interactive())
shinyApp(ui, server)