Skip to content

carlganz/fullcalendarWidget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis-CI Build Status

fullcalendarWidget

The goal of fullcalendarWidget is to provide interactive calendars as an HTMLWidget using the fullcalendar library.

Installation

You can install fullcalendarWidget from github with:

# install.packages("devtools")
devtools::install_github("CannaData/fullcalendarWidget")

Example

You can run fullcalendar in the console (it works in RStudio at least)

library(fullcalendarWidget)
# blank calendar of current month
fullcalendar()
# with events
fullcalendar(events = data.frame(title = "Event", date = Sys.Date()))
# with options and callbacks
fullcalendar(options = list(header = list(left = "", center = "", right = "prev,next")),
            callbacks = list(dayClick = DT::JS(
            "function(date, jsEvent, view) {
              alert(date.format());
            }"
            )))

You can also use in shiny

library(shiny)
library(fullcalendarWidget)

ui <- fluidPage(textInput("text","Edit Text Here", "Example Text"), fullcalendarOutput("test"))

server <- function(input, output, server) {
  output$test <- renderFullcalendar({
    fullcalendar(
      events = data.frame(
        id = 1:2,
        title = c("Event 1", input$text),
        start = Sys.Date() + 0:1,
        color = c("blue", "orange")
      ),
      options = list(header = list(
        left = "",
        center = "",
        right = "prev,next"
      )),
      callbacks = list(
        dayClick = DT::JS(
          "function(date, jsEvent, view) {
          alert('Clicked on: ' + date.format());
  }"
        )
      )
    )
  })
}

shinyApp(ui, server)

About

Wrapper for fullcalendar js library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages