dreamRs / toastui

R htmlwidgets for ToastUI libraries: grid, calendar and chart
https://dreamrs.github.io/toastui
Other
82 stars 8 forks source link

Navigation does not work outside of month view #30

Closed andrewsrs closed 1 year ago

andrewsrs commented 1 year ago

The navigation dates show the correct value only for the month view. Is this the intended behavior?

library(shiny)
library(toastui)

ui <- fluidPage(
    tags$h2("Change calendar view"),
    radioButtons(
        inputId = "view",
        label = "Change view:",
        choices = c("day", "week", "month"),
        inline = TRUE
    ),
    calendarOutput(outputId = "my_calendar")
)

server <- function(input, output, session) {
    output$my_calendar <- renderCalendar({
        calendar(
            view = "day",
            navigation = TRUE,
            navOpts = navigation_options(fmt_date = "MMMM D, YYYY"),
            scheduleView = "allday",
        ) %>%
            cal_schedules(
                title = "Today planning",
                start = Sys.Date(),
                end = Sys.Date(),
                category = "allday"
            )
    })
    observeEvent(input$view,
                 cal_proxy_view("my_calendar", input$view),
                 ignoreInit = TRUE)
}

if (interactive())
    shinyApp(ui, server)

`

pvictor commented 1 year ago

No, that's not the intended behavior, that's fixed in dev version.

Victor

andrewsrs commented 1 year ago

Yes it is, thanks!