Giter VIP home page Giter VIP logo

fullcalendar-columns's Introduction

fullcalendar-columns

A FullCalendar extension that adds support for multiple columns (/resources) per day. Tested with FullCalendar v2.3.1 but not compatible with FullCalendar >= 2.5. It is recommended that for these higher versions you use the "vertical resource view" of the official Scheduler plugin.

Live demo

http://jsfiddle.net/jkmda709/25/

Usage

Include after fullcalendar.js:

<script type="text/javascript" src="fullcalendar.js">
<script type="text/javascript" src="fullcalendar-columns.js">

In your FullCalendar options dictionary, define a view of type multiColAgenda. Set numColumns to the number of columns you want displayed. You can optionally specify the columnHeaders parameter if you want a label to be displayed at the top of each column:

$("#calendar").fullCalendar({
    views: {
        multiColAgendaDay: {
            type: 'multiColAgenda',
            duration: { days: 1 },
            numColumns: 2,
            columnHeaders: ['First column', 'Second column']
        }
    },
    defaultView: 'multiColAgendaDay'
});

From then on, each FullCalendar Event Object can have a column attribute, which specifies which column of a day the event belongs to. For example, using FullCalendar's events option:

events: [{
    title: 'Some event',
    start: moment(), // now
    end: moment().add(1, 'hour'), // in 1 hour
    column: 1
}]

This defines an event in the second column of the current day.

Advantages

Unlike other similar solutions, this is not a fork of FullCalendar. This has the advantage that you can use it with newer versions of FullCalendar, and do not have to depend on a probably unmaintained clone.

Caveats

The implementation works by tricking FullCalendar into displaying columns as separate days. For example: A Friday with two columns is rendered behind the scenes by asking FullCalendar to draw two days, Friday and the coming Monday, where Monday corresponds to Friday's second column. Care is taken to make this trick transparent to the user (you), but in some cases this is not 100% possible. For example, some View Object properties such as end do not contain the "correct" value.

Maintenance

This repository captures the state of code which I use in production and currently does not include features which I do not need. However, I am open to feature or pull requests.

fullcalendar-columns's People

Contributors

mherrmann avatar cojack avatar mattdanna avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.