首页 > 解决方案 > 如何为 R Shiny 应用程序制作“日历”?

问题描述

有很多用于在 Web 应用程序中制作日历的 JS 库。

如何使用 Google Calendar for R Shiny 应用程序中的日期标签制作优雅的日历解决方案?

谢谢!

标签: rshinycalendarlabel

解决方案


查看github上的 fullcalendar包,或者您可以将 Google 日历添加到您的网站

library(shiny)
library(fullcalendar)

data = data.frame(title = paste("Event", 1:3),
                  start = c("2017-03-01", "2017-03-01", "2017-03-15"),
                  end = c("2017-03-02", "2017-03-04", "2017-03-18"),
                  color = c("red", "blue", "green"))

ui <- fluidPage(
  column(6,
         fullcalendarOutput("calendar", width = "100%", height = "200px")
  )
)

server <- function(input, output) {
  output$calendar <- renderFullcalendar({
    fullcalendar(data)
  })
}

shinyApp(ui, server)

在此处输入图像描述


推荐阅读