Skip to content

gabdsg/reactive-fullcalendar-scheduler

Repository files navigation

Based on http://fullcalendar.io/ v3.0.1 and https://fullcalendar.io/scheduler/ v1.4.0

For the complete list of changes in version 3, visit the releases page: https://github.com/fullcalendar/fullcalendar/releases

Installation

    meteor add gabdsg:reactive-fullcalendar-scheduler

Usage

Template:

    <template name="myTemplate">
        {{ > ReactiveFullcalendar options=calendarOptions }}
    </template>

Client JS:

    Template.myTemplate.helpers({
        calendarOptions: {
            // While developing, in order to hide the license warning, use the following key
            schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
            // Standard fullcalendar options
            height: 700,
            hiddenDays: [ 0 ],
            slotDuration: '01:00:00',
            minTime: '08:00:00',
            maxTime: '19:00:00',
            lang: 'fr',
            // Function providing events reactive computation for fullcalendar plugin
            events: function(start, end, timezone, callback) {
                console.log(start.format(), end.format());
                // Get events from the CalendarEvents collection
                // return as an array with .fetch()
                var events = CalendarEvents.find({
                     "id"         : "calendar1",
                     "startValue" : { $gte: start.valueOf() },
                     "endValue"   : { $lte: end.valueOf() }
                }).fetch();
                callback(events);
            },
            // Optional: id of the calendar
            id: "calendar1",
            // Optional: Additional classes to apply to the calendar
            addedClasses: "col-md-8",
            // Optional: Additional functions to apply after each reactive events computation
            autoruns: [
                function () {
                    console.log("user defined autorun function executed!");
                }
            ]
        },
    });

More details

  • Many fullcalendar can be added on the same page by using different id
  • autoruns need to be an array of functions

History

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published