Description Usage Arguments Examples
Those functions allow to navigate in the calendar from the server in a Shiny application.
1 2 3 4 5 6 7 | cal_proxy_next(proxy)
cal_proxy_prev(proxy)
cal_proxy_today(proxy)
cal_proxy_date(proxy, date)
|
proxy |
A |
date |
A specific date to navigate to. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | if (interactive()) {
library(shiny)
ui <- fluidPage(
tags$h2("Navigate in calendar with actionButtons"),
actionButton(
inputId = "prev",
label = "Previous"
),
actionButton(
inputId = "next_",
label = "Next"
),
actionButton(
inputId = "today",
label = "Today"
),
calendarOutput(outputId = "my_calendar")
)
server <- function(input, output, session) {
output$my_calendar <- renderCalendar({
calendar(defaultView = "month", useNav = FALSE)
})
observeEvent(input$prev, cal_proxy_prev("my_calendar"))
observeEvent(input$next_, cal_proxy_next("my_calendar"))
observeEvent(input$today, cal_proxy_today("my_calendar"))
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.