Skip to content

A quick hack to use FullCalendar to produce calendar htmlwidgets from R

Notifications You must be signed in to change notification settings

jcalve/fullcalendar

 
 

Repository files navigation

fullcalendaR

This is a simple R package that allows you to create calendar widgets from R using the FullCalendar javascript library.

Install by using the devtools package:

devtools::install_github("jcalve/fullcalendar")

Or run from the command line:

R -e "devtools::install()"

Example

calendar_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")
)
## or a javascript function
## calendar_data <- JS(read_file("www/js/calendarEventSource.js"))

settings = list(
  plugins = list("interaction", "dayGrid", "timeGrid"),
  editable = TRUE,
  locale = "es",
  firstDay = 1,
  defaultView = list("dayGridMonth"),
  header = list(
    left = "prev, next today",
    center = "title",
    right = "dayGridMonth, dayGridWeek, dayGridDay"
  ),
  ## Calendar events
  eventClick = JS(read_file("calendarEventClick.js")),
  eventDrop = JS(read_file("calendarEventDrop.js"))
)

fullcalendar(calendar_data, settings = settings)

About

A quick hack to use FullCalendar to produce calendar htmlwidgets from R

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.6%
  • Other 1.4%