Event Calendar for jQuery and jQuery Mobile

Learn about Event Calendar

Responsive event calendar with month view, variable week view, range view and event listing.

Supporting one-time, recurring, all-day and multi-day events with pop-over and schedule listing capability. Use it for mobile, desktop and responsive websites.

Shipping with useful features for a refined UX, including:

  • Usage on mobile and desktop with responsive features
  • Single and multi-day events
  • One-time and recurring events
  • Daily, weekly, monthly and custom event schedules
  • Month view, week view and range view
  • Liquid layout with inline display mode
  • Pop-over event listing or list view for schedule
  • Multiple theme support
  • RTL support
  • Full localization


Interested in calendar views? Other demos that could be useful:

Calendar Range


Event calendar demos available for other frameworks.

Viewing demos & code for

light
dark

Change the theme setting here

Event Calendar - Mobile month view

Change demo
Mobile month view

Use the event calendar for mobile, desktop and everything in-between. The content perfectly fills the parent container or the mobile screen in full width. You can chooose to render an agenda-view below the calendar broken up into days ordered chronologically. For more ways to customize the agenda view check out this example.

Interested to see how the event calendar looks on largers screens?  Check out the next demo →
$(function () {

    var inst = $('#demo-mobile-month-view').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'month' },
            eventList: { type: 'month' }
        }
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div id="demo-mobile-month-view"></div>

Event Calendar - Desktop month view

Change demo
Desktop month view

Depending on the screen width the calendar seamlesly transforms into a desktop-view using the available space more intelligently. The main difference between the mobile and desktop rendering is how the day cells are laid out. People can now see on a glance how many events a day holds and by clicking on day the event list will show up in a pop-over.

Interested to see how the event calendar looks on smaller screens?  Check out the previous demo →
$(function () {

    var inst = $('#demo-desktop-month-view').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        calendarHeight: 614,
        showEventCount: true
    }).mobiscroll('getInst');
    
    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div id="demo-desktop-month-view"></div>

Event Calendar - Responsive

Change demo
Responsive

The event calendar is fully responsive. It adapts to the available space and fills the screen to look good everywhere. While the you don't have to worry about the width the height can be manually adjusted with the calendarHeight property.

$(function () {

    var inst = $('#demo-responsive-month-view').mobiscroll().eventcalendar({
        lang: '',
        theme: '', 
        display: 'inline',
        calendarHeight: 513,
        view: {
            calendar: {
                labels: true,
                popover: true
            }
        }
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div id="demo-responsive-month-view"></div>

Event Calendar - Variable weeks

Change demo
Variable weeks

The calendar view supports variable weeks. Save space by only displaying one or two weeks or go for a full month where it makes sense. Use the weeks setting that expects a number of rows. The default is six weeks, but feel free to play around.

mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var one, two, three;

    one = $('#demo-one-week-view').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            calendar: { type: 'week' }
        }
    }).mobiscroll('getInst');

    two = $('#demo-two-week-view').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            calendar: { type: 'week', size: 2 }
        }
    }).mobiscroll('getInst');

    three = $('#demo-three-week-view').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            calendar: { type: 'week', size: 3 }
        }
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        one.setEvents(events);
        two.setEvents(events);
        three.setEvents(events);
    }, 'jsonp');

});
<div style="max-width:1100px;margin:0 auto;" mbsc-page>    <div mbsc-form>
        <div class="mbsc-grid">
            <div class="mbsc-row">
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">One week view</div>
                        <div id="demo-one-week-view"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Two week view</div>
                        <div id="demo-two-week-view"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Three week view</div>
                        <div id="demo-three-week-view"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Event Calendar - Compact daily schedule

Change demo
Compact daily schedule

Use a compact week calendar that you can place at the top of your screen and list a daily schedule below. The calendar view is configured with the calendar object (take a look the previous example) while the agenda view is configured by the eventList setting. For more details on the agenda view see this example. Both are set up inside the view setting.

Days with events are marked with a little dot and days without any events have a localized empty view. Btw. the components are completely localized. Go on and check out this example.

$(function () {

    var inst = $('#demo-daily-events').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'week' },
            eventList: { type: 'day' }
        }
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div id="demo-daily-events"></div>

Event Calendar - Switching views

Change demo
Switching views

Dynamically switch views within one calendar instance. Use a UI control to let users do the switching or do it programatically.

The example features a month view with full event schedule, a week view with a weekly schedule and daily event list. Use the option method to dynamically change the settings.

Interested in building more complex views?  See how to synchronize a calendar and a separate event list →
mobiscroll.settings = {
    lang: '',
    theme: ''
};


$(function () {
    var now = new Date(),
        calendar = $('#demo').mobiscroll().eventcalendar({
            display: 'inline',
            view: {
                calendar: { type: 'month' },
                eventList: { type: 'month' }
            },
            onInit: function (event, inst) {
                mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
                    inst.setEvents(events);
                }, 'jsonp');
            }
        }).mobiscroll('getInst');


    $('.md-view-change').change(function (ev) {
        switch (ev.target.value) {
            case 'month':
                calendar.option({
                    view: {
                        calendar: { type: 'month' },
                        eventList: { type: 'month' }
                    }
                })
                break;
            case 'week':
                calendar.option({
                    view: {
                        calendar: { type: 'week' },
                        eventList: { type: 'week' }
                    }
                })
                break;
            case 'day':
                calendar.option({
                    view: {
                        eventList: { type: 'day' }
                    }
                })
                break;
        }
    });
});
<div mbsc-form>
    <div class="mbsc-align-center">
        <div class="mbsc-note mbsc-note-primary">Dynamically switch between week, month and day views with code or UI.</div>
    </div>
    <div class="mbsc-form-group">
        <div class="mbsc-form-group-title">Month, week and day view</div>
        <label>
            Month
            <input type="radio" data-role="segmented" name="view" value="month" class="md-view-change" checked>
        </label>
        <label>
            Week
            <input type="radio" data-role="segmented" name="view" value="week" class="md-view-change">
        </label>
        <label>
            Day
            <input type="radio" data-role="segmented" name="view" value="day" class="md-view-change">
        </label>
        <div id="demo"></div>
    </div>
</div>

Event Calendar - Agenda view

Change demo
Agenda view

Use the eventList object, configurable inside the view setting to render a scrollable schedule or agenda view. type and size can be set:

  • day - eventList: { type: 'day', size: 20 } can be configured for a single day or a range of days
  • week - eventList: { type: 'week', size: 3 } can be configured for a single week or a range
  • month - eventList: { type: 'month' } can be configured for a single month or a range
Interested in combining this with a calendar view?  Check out the previous example →
mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var daily, weekly, monthly;

    daily = $('#demo-agenda-daily').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            eventList: { type: 'day' }
        }
    }).mobiscroll('getInst');

    weekly = $('#demo-agenda-weekly').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            eventList: { type: 'week' }
        }
    }).mobiscroll('getInst');

    monthly = $('#demo-agenda-monthly').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            eventList: { type: 'month' }
        }
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events-new/', function (events) {
        daily.setEvents(events);
        weekly.setEvents(events);
        monthly.setEvents(events);
    }, 'jsonp');

});
<div style="max-width:1100px;margin:0 auto;" mbsc-page>    <div mbsc-form>
        <div class="mbsc-grid">
            <div class="mbsc-row">
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Daily schedule</div>
                        <div id="demo-agenda-daily"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Weekly schedule</div>
                        <div id="demo-agenda-weekly"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Monthly schedule</div>
                        <div id="demo-agenda-monthly"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Event Calendar - Synchronized views

Change demo
Synchronized views

You can usually get away with using a single event calendar instance, but being able to use and synchronize multiple views can come in handy.

In this example we have a two-pane layout with a calendar view on the left and a large agenda view on the right. Because the default rendering of agenda below the calendar doesn't fit we'll be needing two instances. The sync has to happen for both. The day view calls the navigate method of the calendar in its onPageChange event, while the calendar sets the day view with navigate from its onSetDate event.

$(function () {

    var monthInst,
        dayInst,
        preventSet;
        
    dayInst = $('#demo-day').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            eventList: { type: 'day' }
        },
        onPageChange: function (event, inst) {
            preventSet = true;
            navigate(monthInst, event.firstDay);
        }
    }).mobiscroll('getInst');

    monthInst = $('#demo-month').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'month' }
        },
        onSetDate: function (event, inst) {
            if (!preventSet) {
                navigate(dayInst, event.date);
            }
            preventSet = false;
        }
    }).mobiscroll('getInst');


    function navigate(inst, val) {
        if (inst) {
            inst.navigate(val);
        }
    }
    
    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        dayInst.setEvents(events);
        monthInst.setEvents(events);
    }, 'jsonp');

});
<div class="mbsc-grid md-demo-synchronized-views">
    <div class="mbsc-row mbsc-no-padding">
        <div class="mbsc-col-md-4 mbsc-col-12">
            <div id="demo-month"></div>
        </div>
        <div class="mbsc-col-md-8 mbsc-col-12 md-col-right">
            <div id="demo-day"></div>
        </div>
    </div>
</div>
.md-demo-synchronized-views {
    position: absolute;
    height: 100%;
}

.md-demo-synchronized-views .mbsc-row {
    height: 100%;
}

.md-demo-synchronized-views .md-col-right {
    overflow: auto;
    height: 100%;
    border-left: 1px solid #ccc;
}

Event Calendar - Marked, colored & labels

Change demo
Marked, colored & labels

For additional information you can mark days with colored dots, add labels or completely color the background of the days. This offers means to add more information to the calemdar that is valuable to users. Take a look at this example of marked days and description.

You can add these with exact dates, ranges, days of week, days of month and recurring dates. When processing a lot of data you can load the marked days, labels, colors dynamically in the onMonthChange event.

Want to show event data and use multiple labels?  We have an example for that →
// Use the settings object to change the theme
mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var now = new Date();

    $('#demo-marked').mobiscroll().eventcalendar({
        display: 'inline',
        marked: [
            { d: '5/1', color: '#ffc400' },
            { d: '12/24', color: '#ffee00' },
            { d: '12/25', color: 'red' },
            { d: new Date(now.getFullYear(), now.getMonth() + 1, 4) },
            { d: new Date(now.getFullYear(), now.getMonth() - 2, 13) },
            { d: new Date(now.getFullYear(), now.getMonth(), 2), color: '#46c4f3' },
            { d: new Date(now.getFullYear(), now.getMonth(), 6), color: '#7e56bd' },
            { d: new Date(now.getFullYear(), now.getMonth(), 11), color: '#7e56bd' },
            { d: new Date(now.getFullYear(), now.getMonth(), 19), color: '#89d7c9' },
            { d: new Date(now.getFullYear(), now.getMonth(), 28), color: '#ea4986' },
            { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#7e56bd' },
            { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#f13f77' },
            { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#89d7c9' },
            { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#8dec7d' },
            { d: new Date(now.getFullYear(), now.getMonth(), 21), color: '#ffc400' },
            { d: new Date(now.getFullYear(), now.getMonth(), 21), color: '#8dec7d' },
            { start: new Date(now.getFullYear(), now.getMonth() + 1, 15), end: new Date(now.getFullYear(), now.getMonth() + 1, 18), color: '#f4511e' }
        ]
    });

    $('#demo-colored').mobiscroll().eventcalendar({
        display: 'inline',
        colors: [
            { d: '12/8', background: '#9ccc65' },
            { d: '5/1', background: 'red' },
            { d: '12/24', background: "#fff568" },
            { d: '12/25', background: "#e88080" },
            { d: new Date(now.getFullYear(), now.getMonth() + 1, 4), background: '#cfd8dc' },
            { d: new Date(now.getFullYear(), now.getMonth() + 2, 24), background: '#9575cd' },
            { d: new Date(now.getFullYear(), now.getMonth() - 2, 13), background: '#d4e157' },
            { d: new Date(now.getFullYear(), now.getMonth() - 1, 6), background: "#f4511e" },
            { d: new Date(now.getFullYear(), now.getMonth() + 1, 6), background: '#46c4f3' },
            { d: new Date(now.getFullYear(), now.getMonth() + 1, 22), background: '#7e56bd' },
            { d: new Date(now.getFullYear(), now.getMonth() - 1, 11), background: '#46c4f3' },
            { d: new Date(now.getFullYear(), now.getMonth() - 1, 29), background: '#7e56bd' },
            { d: new Date(now.getFullYear(), now.getMonth(), 2), background: '#46c4f3' },
            { d: new Date(now.getFullYear(), now.getMonth(), 3), background: '#7e56bd' },
            { d: new Date(now.getFullYear(), now.getMonth(), 11), background: '#f13f77' },
            { d: new Date(now.getFullYear(), now.getMonth(), 19), background: '#8dec7d' },
            { d: new Date(now.getFullYear(), now.getMonth(), 28), background: '#ea4986' },
            { start: new Date(now.getFullYear(), now.getMonth() + 1, 15), end: new Date(now.getFullYear(), now.getMonth() + 1, 18), text: 'Conference', background: '#f4511e' }
        ]
    });

    $('#demo-labels').mobiscroll().eventcalendar({
        display: 'inline',
        labels: [
            { d: '12/25', text: 'Christmas', color: "#f48fb1" },
            { d: '1/1', text: 'New year' },
            { d: '12/1', text: 'Meeting', color: '#ffc400' },
            { d: new Date(now.getFullYear(), now.getMonth() + 1, 4), text: 'Spa day', color: '#cfd8dc' },
            { d: new Date(now.getFullYear(), now.getMonth() + 2, 24), text: 'BD Party', color: '#9ccc65' },
            { d: new Date(now.getFullYear(), now.getMonth() - 2, 13), text: 'Exams', color: '#d4e157' },
            { d: new Date(now.getFullYear(), now.getMonth() - 1, 6), text: 'Trip', color: "#f4511e" },
            { d: new Date(now.getFullYear(), now.getMonth() + 1, 6), color: '#46c4f3', text: 'Pizza Night' },
            { d: new Date(now.getFullYear(), now.getMonth() + 1, 22), color: '#7e56bd', text: 'Beerpong' },
            { d: new Date(now.getFullYear(), now.getMonth() - 1, 11), color: '#46c4f3', text: 'Anniversary' },
            { d: new Date(now.getFullYear(), now.getMonth() - 1, 29), color: '#7e56bd', text: 'Pete BD' },
            { d: new Date(now.getFullYear(), now.getMonth(), 2), color: '#46c4f3', text: 'Ana BD' },
            { d: new Date(now.getFullYear(), now.getMonth(), 3), color: '#7e56bd', text: 'Concert' },
            { d: new Date(now.getFullYear(), now.getMonth(), 11), color: '#f13f77', text: 'Trip' },
            { d: new Date(now.getFullYear(), now.getMonth(), 19), color: '#8dec7d', text: 'Math exam' },
            { d: new Date(now.getFullYear(), now.getMonth(), 28), color: '#ea4986', text: 'Party' },
            { start: new Date(now.getFullYear(), now.getMonth() + 1, 15), end: new Date(now.getFullYear(), now.getMonth() + 1, 18), text: 'Conference', color: '#f4511e' }
        ]
    });

});
<div style="max-width:1100px;margin:0 auto;" mbsc-page>    <div mbsc-form>
        <div class="mbsc-grid">
            <div class="mbsc-row">
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Marked days</div>
                        <div id="demo-marked"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Colored days</div>
                        <div id="demo-colored"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Labels</div>
                        <div id="demo-labels"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Event Calendar - Events as labels

Change demo
Events as labels

Events can be displayed a couple of different ways. Most of the time showing the event data inside and across the calendar cells is the way to go.

When configuring the calendar object, you can set labels: true. All of this happens under the view setting.

Rather show events in a pop-over?  Take a look at the next example →
$(function () {

    var inst = $('#demo-events-labels').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        calendarHeight: 614,
        view: {
            calendar: {
                labels: true
            }
        }
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div id="demo-events-labels"></div>

Event Calendar - Events in popover

Change demo
Events in popover

Besides displaying event labels or listing them in an agenda view, you can have them show up in a pop-over. Set it up though the calendar: {popover: true} object inside the view setting. Using the popover setting saves vertical space and provides a subtle cue to the user that there are events. A small dot will apear in day cells with events.

Would a full-blown event list help?  Take a look at the next example →
$(function () {

    var inst = $('#demo-event-popover').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline'
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div style="max-width:1000px;margin:0 auto;" mbsc-page>    <div id="demo-event-popover"></div>
</div>

Event Calendar - Events in agenda view

Change demo
Events in agenda view

The calendar view ships with two methods for listing events. Either as event labels or in a pop-over. Besides these two the third way is to configure an event list under the view setting.

Configure the event list like this view: {eventList: {type: 'month'}}.

Looking for more options for event lists?  Try the daily/weekly/monthly schedule →
$(function () {

    var inst = $('#demo').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'month' },
            eventList: { type: 'month' }
        }
    }).mobiscroll('getInst');
    
    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div class="mbsc-grid-fixed mbsc-grid-md">
    <div id="demo"></div>
</div>

Event Calendar - Custom event data

Change demo
Custom event data
Event calendar with custom HTML for formatted event data. Bake in any markup, emoji or styling into the event list.
$(function () {

    var now = new Date();

    $('#demo').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'month' },
            eventList: { type: 'month' }
        },
        cssClass: 'md-custom-data',
        data: [{
        d: new Date(now.getFullYear(), now.getMonth(), 8, 8, 0),
        text: 'Green box to post office',
        color: '#6e7f29',
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 8, 45),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 9, 0),
        text: 'Quick mtg. with Martin <div class="mbsc-bold md-event-desc">Deal offer</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>13 Walnut Avenue, Eden Hazelton</div><span class="md-event-emoji">🎉</span>',
        color: '#de3d83',
        category: 'meeting',
        location: '13 Walnut Avenue, Eden Hazelton'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 9, 30),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 10, 30),
        text: 'Product team mtg. <div class="mbsc-bold md-event-desc">Promote Justin</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">💬</span>',
        color: '#f67944',
        category: 'meeting',
        location: 'Office'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 11, 0),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 11, 30),
        text: 'Stakeholder mtg. <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">💬</span>',
        color: '#f67944',
        category: 'meeting',
        location: 'Office'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 13, 0),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 13, 30),
        text: 'Pick up Kate <div class="mbsc-bold md-event-desc">Lunch @ Butcher\'s</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>38 Hardman Road, Cedar Court</div><span class="md-event-emoji">🍔</span>',
        color: '#00aabb',
        category: 'date',
        location: '38 Hardman Road, Cedar Court'
    }, {
        start: new Date(now.getFullYear(), 9, 9, 9),
        text: 'Coffee with Steve <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>1334 Rose Street, Walpole</div><span class="md-event-emoji">☕</span>',
        color: '#00aabb',
        category: 'coffee break',
        location: '1334 Rose Street, Walpole'
    }, {
        start: new Date(now.getFullYear(), 10, 2, 12),
        text: 'Trip to England <div class="mbsc-bold md-event-desc">Family visit</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Evergreen Drive</div><span class="md-event-emoji">✈</span>',
        color: '#00aabb',
        category: 'vacation',
        location: 'Evergreen Drive'
    }, {
        start: new Date(now.getFullYear(), 4, 3, 11),
        end: new Date(now.getFullYear(), 4, 3, 12),
        text: 'Photoshoot <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>431 Durham Road, Indianapolis</div><span class="md-event-emoji">📸</span>',
        color: '#00aabb',
        category: 'hobby',
        location: '431 Durham Road, Indianapolis'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 17, 30, 0),
        text: 'Shopping with mom <div class="mbsc-bold md-event-desc">List on the fridge</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>587 Grant Street, Montpelier</div><span class="md-event-emoji">🛒</span>',
        color: '#f67944',
        category: 'hobby',
        location: '587 Grant Street, Montpelier'
    }, {
        d: (now.getMonth() + 1) + '/14',
        text: 'Dexter BD <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>52 Crescent Street, Phoenix</div><span class="md-event-emoji">🎂</span>',
        color: '#37bbe4',
        category: 'party',
        location: '52 Crescent Street, Phoenix'
    }, {
        d: (now.getMonth() + 1) + '/5',
        text: 'Luke BD <div class="mbsc-bold md-event-desc">Party at 4 PM</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>57 Mulberry Street, Fremont</div><span class="md-event-emoji">🎉</span>',
        color: '#37bbe4',
        category: 'birthday',
        location: '57 Mulberry Street, Fremont'
    }, {
        d: 'w3',
        text: 'Employment <div class="mbsc-bold md-event-desc">Semi-weekly</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">✍</span>',
        color: '#635045',
        category: 'meeting',
        location: 'Office'
    }, {
        d: 'w5',
        text: 'Employment <div class="mbsc-bold md-event-desc">Semi-weekly</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">✍</span>',
        color: '#ff9966',
        category: 'meeting',
        location: 'Office'
    }, {
        start: new Date(now.getFullYear(), 1, 7),
        end: new Date(now.getFullYear(), 1, 25),
        text: 'Dean OFF <div class="mbsc-bold md-event-desc">Vacation</div><span class="md-event-emoji">🌄</span>',
        color: '#99ff33',
        category: 'vacation'
    }, {
        start: new Date(now.getFullYear(), 2, 1),
        end: new Date(now.getFullYear(), 2, 14),
        text: 'Mike probation time <div class="mbsc-bold md-event-desc">Jack\'s supervision</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">📋</span>',
        color: '#e7b300',
        category: 'work',
        location: 'Office'
    }, {
        start: new Date(now.getFullYear(), 4, 7),
        end: new Date(now.getFullYear(), 4, 16),
        text: 'John OFF <div class="mbsc-bold md-event-desc">Sick leave</div><span class="md-event-emoji">💊</span>',
        color: '#669900',
        category: 'sickness',
    }, {
        start: new Date(now.getFullYear(), 5, 1),
        end: new Date(now.getFullYear(), 5, 11),
        text: 'Carol OFF <div class="mbsc-bold md-event-desc">Personal problems</div>',
        color: '#6699ff',
        category: 'vacation'
    }, {
        start: new Date(now.getFullYear(), 6, 2),
        end: new Date(now.getFullYear(), 6, 17),
        text: 'Business trip <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>5th Street North</div><span class="md-event-emoji">🚌</span>',
        color: '#cc9900',
        category: 'vacation',
        location: '5th Street North'
    }, {
        start: new Date(now.getFullYear(), 7, 6),
        end: new Date(now.getFullYear(), 7, 14),
        text: 'Ashley OFF <div class="mbsc-bold md-event-desc">On a trip</div><span class="md-event-emoji">🚌</span>',
        color: '#339966',
        category: 'vacation'
    }, {
        start: new Date(now.getFullYear(), 8, 10),
        end: new Date(now.getFullYear(), 8, 20),
        text: 'Marisol OFF <div class="mbsc-bold md-event-desc">Family time</div><span class="md-event-emoji">👨‍‍👧‍👦</span>',
        color: '#8701a9',
        category: 'vacation'
    }, {
        start: new Date(now.getFullYear(), 9, 1),
        end: new Date(now.getFullYear(), 9, 4),
        text: 'Sharon OFF <div class="mbsc-bold md-event-desc">Sick leave</div><span class="md-event-emoji">🤕</span>',
        color: '#cc6699',
        category: 'sickness'
    }, {
        d: '12/25',
        text: 'Christmas Day <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Home</div><span class="md-event-emoji">🎄</span>',
        color: '#ff0066',
        category: 'holiday',
        location: 'Home'
    }, {
        d: '1/1',
        text: 'New Year\'s day <span class="md-event-emoji">🎆</span>',
        color: '#99ccff',
        category: 'holiday'
    }, {
        d: '4/1',
        text: 'April Fool\'s Day <div class="mbsc-bold md-event-desc">Just kidding!</div><span class="md-event-emoji">🤡</span>',
        color: '#ff6666',
        category: 'joke'
    }, {
        d: '11/2',
        text: 'File Form 720 for the third quarter <span class="md-event-emoji">📃</span>',
        color: '#a63e14',
        category: 'work'
    }]
    });
});
<div id="demo"></div>
.md-custom-data .mbsc-event-txt {
    line-height: 1.3em;
}

.md-event-loc {
    padding-top: .5em;
    font-size: 12px;
}

.md-event-emoji {
    position: absolute;
    top: 19px;
    right: 15px;
    font-size: 14px;
}

.md-event-desc+.md-event-loc+.md-event-emoji {
    top: 30px;
}

.md-event-loc .mbsc-ic-location {
    margin-right: 5px;
}

Event Calendar - Date types

Change demo
Date types

The event calendar support multiple data types. The data, marked, colors and labels objects all understand the different formats. Let's see how they look:

  • JS date objects - new Date(1995, 11, 17, 15, 24)
  • ISO date strings - '2008-09-15T15:53:00'
  • Localized date strings - '04/25/2010 8:15 AM'
  • Moment.js objects - moment([2018, 3, 27, 12, 15])
mobiscroll.settings = {
    lang: '',
    theme: '',
    display: 'inline'
};

$(function () {

    var obj, iso, momentJs;

    obj = $('#demo-date-type-obj').mobiscroll().eventcalendar().mobiscroll('getInst');

    iso = $('#demo-date-type-iso').mobiscroll().eventcalendar().mobiscroll('getInst');

    momentJs = $('#demo-date-type-moment').mobiscroll().eventcalendar().mobiscroll('getInst');

    $('#addDate').click(function () {
        obj.addEvent({
            start: new Date(2019, 4, 8, 10, 45),
            end: new Date(2019, 4, 8, 11, 45),
            text: 'New Event'
        });
        obj.navigate(new Date(2019, 4, 8));
    });

    $('#addISO').click(function () {
        iso.addEvent({
            start: '2019-09-15T15:30:00',
            end: '2019-09-15T16:00:00',
            text: 'New Event'
        });
        iso.navigate('2019-09-15');
    });

    $('#addMoment').click(function () {
        // make sure that moment js is loaded
        momentJs.addEvent({
            start: moment([2019, 3, 20, 18]),
            end: moment([2019, 3, 20, 20]),
            text: 'New Event'
        });
        momentJs.navigate(moment([2019, 3, 20]));
    });

});
<div style="max-width:1100px;margin:0 auto;" mbsc-page>    <div mbsc-form>
        <div class="mbsc-grid">
            <div class="mbsc-row">
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Date object</div>
                        <div class="mbsc-btn-group-block">
                            <button id="addDate" class="mbsc-btn-primary">start: new Date(2019, 4, 8, 10, 45) <br /> end: new Date(2019, 4, 8, 11, 45)</button>
                        </div>
                        <div id="demo-date-type-obj"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">ISO string</div>
                        <div class="mbsc-btn-group-block">
                            <button id="addISO" class="mbsc-btn-primary">start: 2019-09-15T15:30:00 <br /> end: 2019-09-15T16:00:00</button>
                        </div>
                        <div id="demo-date-type-iso"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Moment js</div>
                        <div class="mbsc-btn-group-block">
                            <button id="addMoment" class="mbsc-btn-primary">start: moment([2019, 3, 20, 18]) <br /> end: moment([2019, 3, 20, 20])</button>
                        </div>
                        <div id="demo-date-type-moment"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Event Calendar - Event data structure

Change demo
Event data structure

The event data structure for is straightforward with a couple of base properties that the component understands and uses to render the UI. Besides the base properties you can add any custom property, like location, description ...

  • text - Defines the event text. This can be plaintext or HTML
  • color - Defines the event color
  • start - Sets the start date and time for the event. It can be a date object, ISO date string or moment.js object
  • end - Sets the end date and time for the event. The same formats are supported as for start

This is how a simple event looks like with a couple of extra properties:

{
    text: 'Product planning',
    color: '#56ca70',
    start: new Date(2018, 11, 21, 13, 00),
    end: new Date(2018, 11, 21, 14, 00),
    busy: true,
    description: 'Weekly meeting with team',
    location: 'Office'
}

mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var inst = $('#demo-data-structure').mobiscroll().eventcalendar({
        display: 'inline'
    }).mobiscroll('getInst');

    inst.navigate(new Date(2018, 11, 21));

    $('#data-str-btn').on('click', function () {
        inst.addEvent({
            text: 'Product planning',
            color: '#56ca70',
            start: new Date(2018, 11, 21, 13, 00),
            end: new Date(2018, 11, 21, 14, 00),
            busy: true,
            description: 'Weekly meeting with team',
            location: 'Office'
        });
    });

});
<div style="max-width:900px;margin:0 auto;" mbsc-page>    <div mbsc-form>
        <div class="mbsc-grid">
            <div class="mbsc-row mbsc-justify-content-center">
                <div class="mbsc-col-sm-12 mbsc-col-md-7">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Base properties</div>
                        <label>
                            Text
                            <input id="data-str-text" value="Product planning" disabled />
                        </label>
                        <label>
                            Color
                            <input id="data-str-color" value="#56ca70" disabled />
                        </label>
                        <label>
                            Start
                            <input id="data-str-start" value="new Date(2018, 11, 21, 13, 00)" disabled />
                        </label>
                        <label>
                            End
                            <input id="data-str-end" value="new Date(2018, 11, 21, 14, 00)" disabled />
                        </label>
                    </div>
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Add any property you'd like</div>
                        <label>
                            Busy
                            <input id="data-str-busy" value="false" disabled />
                        </label>
                        <label>
                            Description
                            <input id="data-str-desc" value="Weekly meeting with team" disabled />
                        </label>
                        <label>
                            Location
                            <input id="data-str-loc" value="Office" disabled />
                        </label>
                    </div>
                    <button id="data-str-btn">Add event to calendar</button>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-5">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Event calendar</div>
                        <div id="demo-data-structure"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Event Calendar - Events from remote API

Change demo
Events from remote API
Event calendar demo with data loading from remote API. Load and populate with events coming from external JSON.
$(function () {

    var inst = $('#demo-remote-api').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'month' },
            eventList: { type: 'month' }
        }
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        inst.setEvents(events);
    }, 'jsonp');

});
<div id="demo-remote-api"></div>

Event Calendar - Loading events on demand

Change demo
Loading events on demand
Event calendar demo with dynamic data. Load events on demand with month change from external JSON API.
$(function () {

    $('#demo').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'month' },
            eventList: { type: 'month' }
        },
        onPageLoading: function (event, inst) {
            var year = event.firstDay.getFullYear(),
                month = event.firstDay.getMonth();

            mobiscroll.util.getJson('https://trial.mobiscroll.com/monthlyevents/?year=' + year + '&month=' + month, function (data) {
                var events = [];

                for (var i = 0; i < data.length; i++) {
                    events.push({
                        start: data[i].start,
                        end: data[i].end,
                        d: data[i].d,
                        text: data[i].text,
                        color: data[i].color
                    });
                }

                inst.setEvents(events);
            }, 'jsonp');
        }
    });

});
<div id="demo"></div>

Event Calendar - Custom data binding

Change demo
Custom data binding
Event calendar demo for syncing google and facebook calendar data. Demonstrates flexible data source and API.
$(function () {

    function getFirstAndLastDay(year, month) {
        firstDay = new Date(year, month, 1);
        lastDay = new Date(year, month + 1, 0);
    }

    function addEventsToList(list, name, id, color, startDate, endDate) {
        list.push({
            start: startDate,
            end: endDate,
            text: name,
            calendarId: id,
            color: color
        });
    }

    function callBackSetEvent(list) {
        if (requestCounter == 0) {
            calendar.mobiscroll('setEvents', list);
        }
    }

    function callBackAddevent(list) {
        calendar.mobiscroll('addEvent', list);
    }

    // Facebook functions
    function loadFacebookSDK() {
        window.fbAsyncInit = function () {
            // init the FB JS SDK
            FB.init({
                appId: '306273539474640', // App ID from the app dashboard
                status: true, // Check Facebook Login status
                xfbml: false // Look for social plugins on the page
            });
        };
        // Load the SDK asynchronously
        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) {
                return;
            }
            js = d.createElement(s);
            js.id = id;
            js.src = "//connect.facebook.net/en_US/all.js";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    }

    function getFBEvents(id, list, callBack, button) {
        var noreply = false;

        if (button) {
            button.text('Syncing...');
        }

        calId[id] = true;

        if (id == 'nfb') {
            noreply = true;
        }

        requestCounter++;

        FB.api('me/events/' + (noreply ? "not_replied" : "") + '?since=' + firstDay.getTime() / 1000 + '&until=' + lastDay.getTime() / 1000 + '', {
            fields: 'name,id,start_time,end_time'
        }, function (resp) {
            if (resp.data) {
                $.each(resp.data, function (i, v) {
                    addEventsToList(list, v.name, id, noreply ? '#3EA9F8' : '#3B5998', new Date(v.start_time), (v.end_time) ? new Date(v.end_time) : '');
                });
                requestCounter--;
            }
            if (button) {
                button.text('Hide');
            }
            callBack(list);
        });
    }

    function clearFBEvents(id, button) {
        var i,
            list = calendar.mobiscroll('getEvents'),
            l = [];

        for (i = 0; i < list.length; i++) {
            if (list[i].calendarId == id) {
                l.push(list[i]._id);
            }
        }

        calendar.mobiscroll('removeEvent', l);

        if (button) {
            button.text("Show");
        }
    }

    function createFBList() {
        if ($('#fbList li').length == 0) {
            $("#fbList").html('<li><h3>Facebook</h3><p>Events Attending</p><a href="#" class="md-cal-sync" id="fb">Show</a><div style="background-color:#3B5998" class="md-cal-color"></div></li>' + '<li><h3>Facebook</h3><p>Events Not Attending</p><a href="#" class="md-cal-sync" id="nfb">Show</a><div style="background-color:#3EA9F8" class="md-cal-color"></div></li>');
        }
    }

    // Google calendars

    // Load the SDK asynchronously
    function loadGoogleSDK() {
        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) {
                return;
            }
            js = d.createElement(s);
            js.id = id;
            js.src = "//apis.google.com/js/client.js?onload=onGoogleLoad";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'google-jssdk'));
    }

    function onGoogleLoad() {
        gapi.auth.init(function () {});
    }

    function getGoogleColors() {
        gapi.client.load('calendar', 'v3', function () {
            var request = gapi.client.calendar.colors.get({
                'fields': 'event'
            });

            request.execute(function (resp) {
                $.each(resp.event, function (i, v) {
                    eventColor[i] = v.background;
                });
            });
        });
    }

    function getGoogleCalendars() {
        getGoogleColors();
        gapi.client.load('calendar', 'v3', function () {

            var html = '',
                request = gapi.client.calendar.calendarList.list({
                    'fields': 'items(backgroundColor,colorId,description,id,summary)'
                });

            request.execute(function (resp) {

                $.each(resp.items, function (i, v) {
                    calendarColors[v.id] = v.backgroundColor;
                    html += '<li><h3>' + v.summary + '</h3><p>' + (v.description || 'No description') + '</p><a href="#" data-calendar-id="' + v.id + '" class="md-cal-sync">Show</a><div style="background-color: ' + v.backgroundColor + '" class="md-cal-color"></div></li>';
                });

                $("#googleList").html(html);
            });
        });
    }

    function getGoogleEvents(id, list, callBack, button) {

        if (button) {
            button.text("Syncing...");
        }

        calId[id] = true;

        requestCounter++;

        gapi.client.load('calendar', 'v3', function () {
            var request = gapi.client.calendar.events.list({
                'calendarId': id,
                'timeMin': firstDay.toISOString(),
                'timeMax': lastDay.toISOString()
            });

            request.execute(function (resp) {
                if (resp.items) {
                    $.each(resp.items, function (i, v) {
                        if (v.start.dateTime) { //events inside a day
                            addEventsToList(list, v.summary || 'No title', id, v.colorId ? eventColor[v.colorId] : calendarColors[id], new Date(v.start.dateTime), new Date(v.end.dateTime));
                        } else { // day or multi day event
                            addEventsToList(list, v.summary || 'No title', id, v.colorId ? eventColor[v.colorId] : calendarColors[id], new Date(v.start.date), ((new Date(v.end.date) - new Date(v.start.date)) / 86400000 == 1) ? '' : new Date(v.end.date));
                        }
                    });
                }

                requestCounter--;

                if (button) {
                    button.text("Hide");
                }

                callBack(list);
            });
        });
    }

    function clearGoogleEvents(id, button) {
        var i,
            list = calendar.mobiscroll('getEvents'),
            l = [];

        for (i = 0; i < list.length; i++) {
            if (list[i].calendarId == id) {
                l.push(list[i]._id);
            }
        }

        calendar.mobiscroll('removeEvent', l);

        if (button) {
            button.text("Show");
        }
    }

    var timer,
        requestCounter = 0,
        clientId = '249451342989-4npidi86thdlqv1ecmp4euncemcg3ocf.apps.googleusercontent.com',
        eventColor = {},
        calendarColors = {},
        calId = {},
        calendar = $('#demo'),
        firstDay = new Date(),
        lastDay = new Date();

    loadGoogleSDK();
    loadFacebookSDK();

    calendar = $('#demo').mobiscroll().eventcalendar({
        theme: '',
        lang: '',
        display: 'inline',
        layout: 'liquid',
        outerMonthChange: false,
        data: [],
        onPageChange: function (event) {
            var list = [],
                year = event.year,
                month = event.month;
            clearTimeout(timer);
            timer = setTimeout(function () {
                getFirstAndLastDay(year, month);
                $.each(calId, function (i) {
                    if (i == 'fb' || i == 'nfb') {
                        getFBEvents(i, list, callBackSetEvent);
                    } else {
                        getGoogleEvents(i, list, callBackSetEvent);
                    }
                });
            }, 100);
        }
    });

    var date = new Date();
    firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
    lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);

    // Facebook auth
    $('#fbAuth').off().on('click', function () {
        FB.getLoginStatus(function (response) {
            if (response.status === 'connected') {
                createFBList();
            } else {
                FB.login(function (response) {
                    if (response.authResponse) {
                        createFBList();
                    }
                }, {
                    scope: 'user_events'
                });
            }
        });
        return false;
    });

    $("#fbList").empty().off().on('click', '.md-cal-sync', function () {
        if ($(this).text() == "Show") {
            getFBEvents($(this).context.id, [], callBackAddevent, $(this));
        } else {
            clearFBEvents($(this).context.id, $(this));
            delete calId[$(this).context.id];
        }
        return false;
    });

    // Google auth
    $('#googleAuth').off().on('click', function () {
        if ($('#googleList li').length == 0) {
            gapi.auth.authorize({
                client_id: clientId,
                scope: 'https://www.googleapis.com/auth/calendar',
                immediate: false
            }, function (authResult) {
                if (authResult) {
                    getGoogleCalendars();
                }
            });
        }
        return false;
    });

    $("#googleList").empty().off().on('click', '.md-cal-sync', function () {
        if ($(this).text() == "Hide") {
            delete calId[$(this).data('calendar-id')];
            clearGoogleEvents($(this).data('calendar-id'), $(this));
        } else {
            getGoogleEvents($(this).data('calendar-id'), [], callBackAddevent, $(this));
        }
        return false;
    });
});
<div class="md-sync" mbsc-form>
    <div class="mbsc-form-group">
        <div id="fb-root"></div>

        <div id="demo"></div>

        <ul id="googleList" class="md-cal-list"></ul>
        <ul id="fbList" class="md-cal-list"></ul>

        <div class="mbsc-btn-group-block">
            <button id="fbAuth" class="md-cal-auth">Add Facebook Events</button>
            <button id="googleAuth" class="md-cal-auth">Add Google Calendars</button>
        </div>
    </div>

</div>
div .md-sync {
    padding: 0;
}

div .md-sync #demo {
    display: block;
}

div .md-sync #show {
    position: static;
}

div .md-sync .icc {
    padding: 0;
}

div .md-sync .ic {
    text-align: left;
}

div .md-sync .ic p {
    padding: 0 5px;
    color: #000;
    text-shadow: none;
}

div .md-sync .md-cal-btn-c .md-cal-auth {
    display: block;
    margin-top: 5px;
    width: 100%;
}

.md-cal-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.md-cal-list li {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f0f0f0;
    border-bottom: 1px solid #b1b1b1;
    border-top: 1px solid #fff;
    padding: 5px 40px 5px 10px;
    color: #333;
}

.md-cal-list h3 {
    margin: 5px 0;
    font-weight: normal;
}

.md-cal-list p {
    display: block;
    margin: 5px 0;
    color: #717171;
}

.md-cal-color {
    width: 5px;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.md-cal-list .md-cal-sync {
    position: absolute;
    right: 0;
    top: 0;
    padding-top: 25px;
    padding-right: 15px;
    text-decoration: underline;
}

.md-cal-btn-c {
    padding: 0 5px;
}

.md-sync {
    padding: 0 !importnat;
}

.demo-preview .demo-note {
    margin: 5px;
}

Event Calendar - Add/delete event

Change demo
Add/delete event

The component renders event data that it gets from an API, however you can manually add and delete events in real time. The idea is to pass the event in the correct format, which means it needs a couple of base properties:

  • d or start & end - Defines the date and length of the event
  • text - Defines the lable for the event, which can be anythng from text to something more complex like HTML
  • color - Defines the color of the event
  • allDay - Sets if the event is an all-day event or not
  • everything else you would like - You can add any additional data that makes sense, like busy or location...

After you have the data object ready with the event data you can pass it to the addEvent method. While the event calendar doesn't ship with a built-in form for adding events, you can use the popup component along with inputs & fields to build the form you need.

Deleting events can be done just as simply by calling the removeEvent method

mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var monthInst,
        dayInst,
        popupInst,
        dateInst,
        preventSet,
        now = new Date(),
        btn = '<button class="mbsc-btn mbsc-btn-outline mbsc-btn-danger md-delete-btn">Delete</button>',
        myData = [{
            start: new Date(now.getFullYear(), now.getMonth(), 8, 13, 0),
            end: new Date(now.getFullYear(), now.getMonth(), 8, 13, 30),
            text: 'Lunch @ Butcher\'s' + btn,
            color: '#26c57d'
        }, {
            start: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 15, 0),
            end: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 16, 0),
            text: 'General orientation' + btn,
            color: '#fd966a'
        }];

    function navigate(inst, val) {
        if (inst) {
            inst.navigate(val);
        }
    }

    dateInst = $('#eventDate').mobiscroll().range({
        controls: ['date', 'time'],
        dateWheels: '|D M d|',
        endInput: '#endInput',
        tabs: false,
        responsive: {
            large: {
                touchUi: false
            }
        },
        showSelector: false,
        cssClass: 'md-add-event-range'
    }).mobiscroll('getInst');

    dayInst = $('#demo-add-event-day').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            eventList: { type: 'day' }
        },
        data: myData,
        onPageChange: function (event, inst) {
            var day = event.firstDay;
            preventSet = true;
            navigate(monthInst, day);
            dateInst.setVal([day, new Date(day.getFullYear(), day.getMonth(), day.getDate(), day.getHours() + 2)], true);
        },
        onEventSelect: function (event, inst) {
            if ($(event.domEvent.target).hasClass('md-delete-btn')) {
                mobiscroll.confirm({
                    title: 'Confirm Deletion',
                    message: 'Are you sure you want to delete this item?',
                    okText: 'Delete',
                    callback: function (res) {
                        if (res) {
                            inst.removeEvent([event.event._id]);
                            monthInst.removeEvent([event.event._id]);
                            mobiscroll.toast({
                                message: 'Deleted'
                            });
                        }
                    }
                });
            }
        }
    }).mobiscroll('getInst');

    monthInst = $('#demo-add-event-month').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            calendar: { type: 'month' }
        },
        data: myData,
        onSetDate: function (event, inst) {
            if (!preventSet) {
                var day = event.date;
                navigate(dayInst, day);
                dateInst.setVal([day, new Date(day.getFullYear(), day.getMonth(), day.getDate(), day.getHours() + 2)], true);
            }
            preventSet = false;
        }
    }).mobiscroll('getInst');

    $('#allDay').on('change', function () {
        var allDay = this.checked;

        dateInst.option({
            controls: allDay ? ['date'] : ['date', 'time'],
            dateWheels: (allDay ? 'MM dd yy' : '|D M d|')
        });
    });

    popupInst = $('#demo-add-event-popup').mobiscroll().popup({
        display: 'center',
        cssClass: 'mbsc-no-padding',
        buttons: [{
                text: 'Add event',
                handler: 'set'
            },
            'cancel'
        ],
        headerText: 'Add new event',
        onSet: function (event, inst) {
            var eventDates = dateInst.getVal(),
                events = {
                    start: eventDates[0],
                    end: eventDates[1],
                    text: ($('#eventText').val() || 'New Event') + btn,
                    title: $('#eventText').val() || 'New Event',
                    description: $('#eventDesc').val(),
                    allDay: $('#allDay').prop('checked'),
                    free: $('input[name=free]:checked').val() == 'true'
                };
            monthInst.addEvent(events);
            dayInst.addEvent(events);
            $('#eventText').val('');
            $('#eventDesc').val('');
            // Navigate the calendar to the new event's start date
            monthInst.navigate(eventDates[0], true);
        }
    }).mobiscroll('getInst');

    $('#showAddEventPopup').off().click(function () {
        popupInst.show();
    });

});
<div mbsc-form>
    <div class="mbsc-grid md-add-event-demo">
        <div class="mbsc-row mbsc-no-padding">
            <div class="mbsc-col-md-4 mbsc-col-12">
                <div id="demo-add-event-month"></div>
                <div class="mbsc-btn-group-block">
                    <button id="showAddEventPopup">Add New Event</button>
                </div>
            </div>
            <div class="mbsc-col-md-8 mbsc-col-12 md-col-right">
                <div id="demo-add-event-day"></div>
            </div>
        </div>
    </div>
</div>

<div id="demo-add-event-popup" class="md-add-event-popup">
    <div mbsc-form>
        <div class="mbsc-form-group">
            <label>
                Title
                <input id="eventText">
            </label>
            <label>
                Description
                <textarea id="eventDesc"></textarea>
            </label>
        </div>
        <div class="mbsc-form-group">
            <label for="allDay">
                All-day
                <input id="allDay" type="checkbox" data-role="switch">
            </label>
            <label for="eventDate">
                Starts
                <input id="eventDate">
            </label>
            <label>
                Ends
                <input id="endInput">
            </label>
            <label>
                Show as busy
                <input type="radio" data-role="segmented" name="free" value="false" checked>
            </label>
            <label>
                Show as free
                <input type="radio" data-role="segmented" name="free" value="true">
            </label>
        </div>
    </div>
</div>
.md-add-event-demo {
    position: absolute;
    height: 100%;
}

.md-add-event-demo .mbsc-row {
    height: 100%;
}

.md-add-event-demo .md-col-right {
    overflow: auto;
    height: 100%;
    border-left: 1px solid #ccc;
}

.md-add-event-demo .md-delete-btn {
    margin: 0;
    position: absolute;
    right: 10px;
    z-index: 1;
    transition: background-color .3s ease-out;
}

.md-add-event-demo .md-delete-btn.mbsc-btn-outline.mbsc-btn:not(:disabled):not(.mbsc-active):hover:hover {
    background: #f5504e;
    color: #fff;
}

.mbsc-rtl .md-add-event-demo .md-delete-btn {
    right: auto;
    left: 10px;
}

.md-add-event-popup {
    max-width: 400px;
}

Event Calendar - View/update event

Change demo
View/update event
mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var popupInst,
        calInst,
        listInst,
        rangeInst,
        colorInst,
        preventSet,
        eventToEdit;

    function saveChanges() {
        var eventToSave = {
            text: $('#eventText').val(),
            desc: $('#eventDesc').val(),
            color: colorInst.getVal(),
            allDay: $('#allDay').mobiscroll('getVal'),
            start: rangeInst.getVal()[0],
            end: rangeInst.getVal()[1],
            free: $('input[name=free]:checked').val() == 'true'
        };

        calInst.removeEvent(eventToEdit._id);
        calInst.addEvent(eventToSave);
        listInst.removeEvent(eventToEdit._id);
        listInst.addEvent(eventToSave);
    }

    function updatePopup() {
        var event = eventToEdit,
            free = event.free ? true : false,
            oneDay = 1000 * 60 * 60 * 24,
            diff = new Date(event.end).getTime() - new Date(event.start).getTime(),
            days = Math.round(Math.abs(diff) / oneDay),
            allDay = event.allDay || days > 0;

        $('#eventText').val(event.text);
        $('#eventDesc').val(event.desc);
        $('#allDay').mobiscroll('setVal', allDay);
        rangeInst.setVal([event.start, event.end], true);
        rangeInst.option({
            controls: allDay ? ['date'] : ['date', 'time'],
            dateWheels: (allDay ? 'MM dd yy' : '|D M d|')
        });
        $('input[name=free][value=' + free + ']').prop('checked', true);
        colorInst.setVal(event.color, true);
    }

    function navigate(inst, val) {
        if (inst) {
            inst.navigate(val);
        }
    }

    popupInst = $('#demo-view-update-popup').mobiscroll().popup({
        display: 'center',
        buttons: [
            'cancel',
            {
                text: 'Save',
                handler: 'set'
            }
        ],
        headerText: 'Edit event',
        onSet: function (event, inst) {
            saveChanges();
        }
    }).mobiscroll('getInst');

    rangeInst = $('#eventDate').mobiscroll().range({
        controls: ['date', 'time'],
        dateWheels: '|D M d|',
        endInput: '#endInput',
        tabs: false,
        responsive: {
            large: {
                touchUi: false
            }
        }
    }).mobiscroll('getInst');

    calInst = $('#demo-view-update-event').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            calendar: {
                type: 'month'
            }
        },
        onSetDate: function (event, inst) {
            if (!preventSet) {
                var day = event.date;
                navigate(listInst, day);
            }
            preventSet = false;
        }
    }).mobiscroll('getInst');

    listInst = $('#demo-view-update-event-list').mobiscroll().eventcalendar({
        display: 'inline',
        view: {
            eventList: { type: 'day' }
        },
        onPageChange: function (event, inst) {
            var day = event.firstDay;
            preventSet = true;
            navigate(calInst, day);
        },
        onEventSelect: function (event, inst) {
            eventToEdit = event.event;
            updatePopup();
            popupInst.show();
        }
    }).mobiscroll('getInst');

    colorInst = $('#eventColor').mobiscroll().color({
        display: 'inline',
        clear: false,
        data: ['#fff568', '#ffc400', '#ff5252', '#f48fb1', '#ba68c8', '#8c9eff', '#90caf9', '#9ccc65', '#0db057', '#bcaaa4']
    }).mobiscroll('getInst');

    $('#allDay').on('change', function () {
        var allDay = this.checked;

        rangeInst.option({
            controls: allDay ? ['date'] : ['date', 'time'],
            dateWheels: (allDay ? 'MM dd yy' : '|D M d|')
        });
    });

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events-update/', function (events) {
        calInst.setEvents(events);
        listInst.setEvents(events);
    }, 'jsonp');

});
<div mbsc-form>
    <div class="mbsc-grid md-view-update-demo">
        <div class="mbsc-row mbsc-no-padding">
            <div class="mbsc-col-md-4 mbsc-col-12">
                <div id="demo-view-update-event"></div>
            </div>
            <div class="mbsc-col-md-8 mbsc-col-12 md-col-right">
                <div id="demo-view-update-event-list"></div>
            </div>
        </div>
    </div>
</div>

<div id="demo-view-update-popup" class="md-view-update-popup">
    <div mbsc-form>
        <div class="mbsc-form-group">
            <label>
                Title
                <input id="eventText">
            </label>
            <label>
                Description
                <textarea id="eventDesc"></textarea>
            </label>
        </div>
        <div class="mbsc-form-group">
            <label for="allDay">
                All-day
                <input id="allDay" type="checkbox" data-role="switch">
            </label>
            <label for="eventDate">
                Starts
                <input id="eventDate">
            </label>
            <label>
                Ends
                <input id="endInput">
            </label>
            <label>
                Show as busy
                <input type="radio" data-role="segmented" name="free" value="false">
            </label>
            <label>
                Show as free
                <input type="radio" data-role="segmented" name="free" value="true">
            </label>
            <div id="eventColor"></div>
        </div>
    </div>
</div>
.md-view-update-demo {
    position: absolute;
    height: 100%;
}

.md-view-update-demo .mbsc-row {
    height: 100%;
}

.md-view-update-demo .md-col-right {
    overflow: auto;
    height: 100%;
    border-left: 1px solid #ccc;
}

.md-view-update-popup {
    max-width: 400px;
}

.md-hidden .mbsc-color-input {
    display: none;
}

Event Calendar - Calendar systems

Change demo
Calendar systems
Event calendar with Gregorian, Hijri and Jalali system supporting different language and culture settings.
mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var gregorian, jalali, hijri;

    gregorian = $('#demo-gregorian').mobiscroll().eventcalendar({
        display: 'inline',
        calendarSystem: 'gregorian'
    }).mobiscroll('getInst');

    jalali = $('#demo-jalali').mobiscroll().eventcalendar({
        display: 'inline',
        calendarSystem: 'jalali',
        lang: 'fa'
    }).mobiscroll('getInst');

    hijri = $('#demo-hijri').mobiscroll().eventcalendar({
        display: 'inline',
        calendarSystem: 'hijri',
        lang: 'ar'
    }).mobiscroll('getInst');

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        gregorian.setEvents(events);
        jalali.setEvents(events);
        hijri.setEvents(events);
    }, 'jsonp');

});
<div style="max-width:1100px;margin:0 auto;" mbsc-page>    <div mbsc-form>
        <div class="mbsc-grid">
            <div class="mbsc-row">
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Gregorian calendar</div>
                        <div id="demo-gregorian"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Jalali calendar</div>
                        <div id="demo-jalali"></div>
                    </div>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-4">
                    <div class="mbsc-form-group">
                        <div class="mbsc-form-group-title">Hijri calendar</div>
                        <div id="demo-hijri"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

Event Calendar - Event handlers

Change demo
Event handlers
Event calendar for mobile and desktop with hooks for custom integration and functionality. With source code.
Clear event log
EVENTS FIRED: 
$(function () {

    var now = new Date();

    $('#demo').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: { type: 'month' },
            eventList: { type: 'month' }
        },
        data: [{
            d: now,
            text: 'Green box to post office',
            color: '#6e7f29'
        }, {
            d: 'w3',
            text: 'Employment (Semi-weekly)',
            color: '#635045'
        }, {
            d: 'w5',
            text: 'Employment (Semi-weekly)',
            color: '#ff9966'
        }, {
            start: new Date(now.getFullYear(), 1, 7),
            end: new Date(now.getFullYear(), 1, 25),
            text: 'Dean OFF',
            color: '#99ff33'
        }, {
            start: new Date(now.getFullYear(), 2, 5),
            end: new Date(now.getFullYear(), 2, 14),
            text: 'Mike OFF',
            color: '#e7b300'
        }, {
            start: new Date(now.getFullYear(), 4, 7),
            end: new Date(now.getFullYear(), 4, 16),
            text: 'John OFF',
            color: '#669900'
        }, {
            start: new Date(now.getFullYear(), 5, 1),
            end: new Date(now.getFullYear(), 5, 11),
            text: 'Carol OFF',
            color: '#6699ff'
        }, {
            start: new Date(now.getFullYear(), 6, 2),
            end: new Date(now.getFullYear(), 6, 17),
            text: 'Jason OFF',
            color: '#cc9900'
        }, {
            start: new Date(now.getFullYear(), 7, 6),
            end: new Date(now.getFullYear(), 7, 14),
            text: 'Ashley OFF',
            color: '#339966'
        }, {
            start: new Date(now.getFullYear(), 8, 10),
            end: new Date(now.getFullYear(), 8, 20),
            text: 'Marisol OFF',
            color: '#8701a9'
        }, {
            start: new Date(now.getFullYear(), 9, 1),
            end: new Date(now.getFullYear(), 9, 12),
            text: 'Sharon OFF',
            color: '#cc6699'
        }, {
            d: '12/25',
            text: 'Christmas Day',
            color: '#ff0066'
        }, {
            d: '1/1',
            text: 'New Year\'s day',
            color: '#99ccff'
        }, {
            d: '4/1',
            text: 'April Fool\'s Day',
            color: '#ff6666'
        }],
        onInit: function (event, inst) {
            // Your custom event handler goes here
        },
        onMarkupReady: function (event, inst) {
            // Your custom event handler goes here
        },
        onBeforeShow: function (event, inst) {
            // Your custom event handler goes here
        },
        onPosition: function (event, inst) {
            // Your custom event handler goes here
        },
        onShow: function (event, inst) {
            // Your custom event handler goes here
        },
        onDestroy: function (event, inst) {
            // Your custom event handler goes here
        },
        onClose: function (event, inst) {
            // Your custom event handler goes here
        },
        onBeforeClose: function (event, inst) {
            // Your custom event handler goes here
        },
        onPageLoading: function (event, inst) {
            // Your custom event handler goes here
        },
        onPageLoaded: function (event, inst) {
            // Your custom event handler goes here
        },
        onPageChange: function (event, inst) {
            // Your custom event handler goes here
        },
        onEventSelect: function (event, inst) {
            // Your custom event handler goes here
        },
        onDayChange: function (event, inst) {
            // Your custom event handler goes here
        },
        onLabelTap: function (event, inst) {
            // Your custom event handler goes here
        },
        onSetDate: function (event, inst) {
            // Your custom event handler goes here
        }
    });

});
<div id="demo"></div>

Event Calendar - Localization

Change demo
Localization
Event calendar localization example supporting 37 languages, date, time formats with full RTL capability.
mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    $('#demo-localization-form').mobiscroll().form({
        inputStyle: 'box',
        labelStyle: 'inline'
    });

    var calInst = $('#demo-localization').mobiscroll().eventcalendar({
        display: 'inline'
    }).mobiscroll('getInst');

    $('#demo-localization-select').mobiscroll().select({
        display: 'bubble',
        touchUi: false,
        onSet: function (event, inst) {
            var la = inst.getVal();

            calInst.option({
                lang: la
            });

            $('#lang-flag').attr('class', 'flag flag-' + la);
        }
    });

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        calInst.setEvents(events);
    }, 'jsonp');

});
<div style="max-width:1000px;margin:0 auto;" mbsc-page>    <div id="demo-localization-form" class="md-localization">
        <div class="mbsc-grid">
            <div class="mbsc-row mbsc-justify-content-center">
                <div class="mbsc-col-sm-7 mbsc-col-md-5 mbsc-col-lg-4">
                    <label>
                    <span id="lang-flag" class="flag flag-en"></span>
                    <select id="demo-localization-select">
                        <option value="en">English</option>
                        <option value="ar">Arabic</option>
                        <option value="bg">Bulgarian</option>
                        <option value="ca">Català</option>
                        <option value="cs">Cestina</option>
                        <option value="zh">Chinese</option>
                        <option value="hr">Croatian</option>
                        <option value="da">Dansk</option>
                        <option value="de">Deutsch</option>
                        <option value="en-UK">English (UK)</option>
                        <option value="es">Español</option>
                        <option value="fr">Français</option>
                        <option value="el">Greek</option>
                        <option value="in">Hindi</option>
                        <option value="it">Italiano</option>
                        <option value="ja">Japanese</option>
                        <option value="ko">Korean</option>
                        <option value="lt">Lietuvių</option>
                        <option value="hu">Magyar</option>
                        <option value="nl">Nederlands</option>
                        <option value="no">Norsk</option>
                        <option value="pl">Polski</option>
                        <option value="pt-PT">Português Europeu</option>
                        <option value="pt-BR">Pt. Brasileiro</option>
                        <option value="ro">Româna</option>
                        <option value="sr">Serbian</option>
                        <option value="sk">Slovencina</option>
                        <option value="fi">Suomi</option>
                        <option value="sv">Svenska</option>
                        <option value="th">Thai</option>
                        <option value="tr">Türkçe</option>
                        <option value="ua">Ukrainian</option>
                        <option value="vi">Vietnamese</option>
                        <option value="ru">Русский</option>
                        <option value="ru-UA">Русский (UA)</option>
                        <option value="he">עברית</option>
                        <option value="fa">فارسی</option>
                    </select>
                </label>
                </div>
            </div>
            <div class="mbsc-row mbsc-justify-content-center">
                <div class="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-lg-6">
                    <div id="demo-localization"></div>
                </div>
            </div>
        </div>
    </div>
</div>
.md-localization span.flag {
    min-width: 22px;
    height: 15px;
    position: relative;
    left: 0;
    margin-right: 1em;
    z-index: 1;
    top: 10px;
}

.mbsc-rtl .md-localization span.flag {
    margin-right: 0;
    margin-left: 1em;
}

.mbsc-ios .md-localization span.flag {
    top: 15px;
    left: 1em;
}

.mbsc-rtl.mbsc-ios .md-localization span.flag {
    right: 1em;
}

.mbsc-windows .md-localization span.flag {
    top: 8px;
}

.md-localization img.flag {
    width: 30px;
}

.md-localization .flag {
    background: url(https://img.mobiscroll.com/demos/flags/flags_responsive.png) no-repeat;
    background-size: 100%;
}

.md-localization .flag-en {
    background-position: 0 93.38843%;
}

.md-localization .flag-ar {
    background-position: 0 76.033058%;
}

.md-localization .flag-bg {
    background-position: 0 9.090909%;
}

.md-localization .flag-ca {
    background-position: 0 14.876033%;
}

.md-localization .flag-cs {
    background-position: 0 21.900826%;
}

.md-localization .flag-zh {
    background-position: 0 19.008264%;
}

.md-localization .flag-hr {
    background-position: 0 38.429752%;
}

.md-localization .flag-da {
    background-position: 0 23.140496%;
}

.md-localization .flag-de {
    background-position: 0 22.31405%;
}

.md-localization .flag-en-UK {
    background-position: 0 92.561983%;
}

.md-localization .flag-es {
    background-position: 0 26.859504%;
}

.md-localization .flag-fr {
    background-position: 0 29.752066%;
}

.md-localization .flag-el {
    background-position: 0 34.710744%;
}

.md-localization .flag-in {
    background-position: 0 40.909091%;
}

.md-localization .flag-it {
    background-position: 0 42.975207%;
}

.md-localization .flag-ja {
    background-position: 0 44.214876%;
}

.md-localization .flag-ko {
    background-position: 0 47.520661%;
}

.md-localization .flag-lt {
    background-position: 0 52.066116%;
}

.md-localization .flag-hu {
    background-position: 0 39.256198%;
}

.md-localization .flag-nl {
    background-position: 0 65.289256%;
}

.md-localization .flag-no {
    background-position: 0 65.702479%;
}

.md-localization .flag-pl {
    background-position: 0 70.661157%;
}

.md-localization .flag-pt-PT {
    background-position: 0 72.31405%;
}

.md-localization .flag-pt-BR {
    background-position: 0 11.983471%;
}

.md-localization .flag-ro {
    background-position: 0 74.380165%;
}

.md-localization .flag-sr {
    background-position: 0 74.793388%;
}

.md-localization .flag-sk {
    background-position: 0 79.752066%;
}

.md-localization .flag-fi {
    background-position: 0 27.68595%;
}

.md-localization .flag-sv {
    background-position: 0 77.68595%;
}

.md-localization .flag-th {
    background-position: 0 85.950413%;
}

.md-localization .flag-tr {
    background-position: 0 89.256198%;
}

.md-localization .flag-ua {
    background-position: 0 91.735537%;
}

.md-localization .flag-vi {
    background-position: 0 96.694215%;
}

.md-localization .flag-ru {
    background-position: 0 75.206612%;
}

.md-localization .flag-ru-UA {
    background-position: 0 10.743802%;
}

.md-localization .flag-he {
    background-position: 0 40.495868%;
}

.md-localization .flag-fa {
    background-position: 0 42.14876%;
}

Event Calendar - Theming capabilities

Change demo
Theming capabilities
mobiscroll.settings = {
    lang: '',
    theme: ''
};

$(function () {

    var ios, material, windows, mobi;

    ios = $('#demo-themes-ios').mobiscroll().eventcalendar({
        theme: 'ios',
        display: 'inline',
        view: {
            calendar: {
                labels: true
            }
        }
    }).mobiscroll('getInst');

    material = $('#demo-themes-material').mobiscroll().eventcalendar({
        theme: 'material',
        display: 'inline',
        view: {
            calendar: {
                labels: true
            }
        }
    }).mobiscroll('getInst');

    windows = $('#demo-themes-windows').mobiscroll().eventcalendar({
        theme: 'windows',
        display: 'inline',
        view: {
            calendar: {
                labels: true
            }
        }
    }).mobiscroll('getInst');

    mobi = $('#demo-themes-mobiscroll').mobiscroll().eventcalendar({
        theme: 'mobiscroll',
        display: 'inline',
        view: {
            calendar: {
                labels: true
            }
        }
    }).mobiscroll('getInst');

    $('.md-demo-themes input[type=radio]').change(function () {
        if (this.name == "ios") {
            ios.option({ theme: this.value });
        } else if (this.name == "material") {
            material.option({ theme: this.value });
        } else if (this.name == "windows") {
            windows.option({ theme: this.value });
        } else if (this.name == "mobiscroll") {
            mobi.option({ theme: this.value });
        }
    });

    mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', function (events) {
        ios.setEvents(events);
        material.setEvents(events);
        windows.setEvents(events);
        mobi.setEvents(events);
    }, 'jsonp');

});
<div style="max-width:1100px;margin:0 auto;">    <div class="mbsc-grid mbsc-grid-fixed md-demo-themes">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-form-group">
                <div mbsc-form>
                    <div class="mbsc-form-group-title">iOS Theme</div>
                    <label>
                        Light
                        <input type="radio" data-role="segmented" name="ios" value="ios" checked>
                    </label>
                    <label>
                        Dark
                        <input type="radio" data-role="segmented" name="ios" value="ios-dark">
                    </label>
                    <label>
                        Custom
                        <input type="radio" data-role="segmented" name="ios" value="ios-gray">
                    </label>
                </div>
                <div id="demo-themes-ios"></div>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-form-group">
                <div mbsc-form>
                    <div class="mbsc-form-group-title">Material Theme</div>
                    <label>
                        Light
                        <input type="radio" data-role="segmented" name="material" value="material" checked>
                    </label>
                    <label>
                        Dark
                        <input type="radio" data-role="segmented" name="material" value="material-dark">
                    </label>
                    <label>
                        Custom
                        <input type="radio" data-role="segmented" name="material" value="material-indigo">
                    </label>
                </div>
                <div id="demo-themes-material"></div>
            </div>
        </div>
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-form-group">
                <div mbsc-form>
                    <div class="mbsc-form-group-title">Windows Theme</div>
                    <label>
                        Light
                        <input type="radio" data-role="segmented" name="windows" value="windows" checked>
                    </label>
                    <label>
                        Dark
                        <input type="radio" data-role="segmented" name="windows" value="windows-dark">
                    </label>
                    <label>
                        Custom
                        <input type="radio" data-role="segmented" name="windows" value="windows-yellow">
                    </label>
                </div>
                <div id="demo-themes-windows"></div>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-form-group">
                <div mbsc-form>
                    <div class="mbsc-form-group-title">Mobiscroll Theme</div>
                    <label>
                        Light
                        <input type="radio" data-role="segmented" name="mobiscroll" value="mobiscroll" checked>
                    </label>
                    <label>
                        Dark
                        <input type="radio" data-role="segmented" name="mobiscroll" value="mobiscroll-dark">
                    </label>
                    <label>
                        Custom
                        <input type="radio" data-role="segmented" name="mobiscroll" value="mobiscroll-lime">
                    </label>
                </div>
                <div id="demo-themes-mobiscroll"></div>
            </div>
        </div>
    </div>
</div>

Event Calendar - Range view

Change demo
Range view
Event calendar two week range demo. Use it with a week calendar and event list for the range. Supports days/weeks.
$(function () {

    var now = new Date();

    $('#demo').mobiscroll().eventcalendar({
        lang: '',
        theme: '',
        display: 'inline',
        view: {
            calendar: {
                type: 'week',
                size: 2,
                popover: false
            },
            eventList: {
                type: 'week',
                size: 2
            }
        },
        data: [{
        d: new Date(now.getFullYear(), now.getMonth(), 8, 8, 0),
        text: 'Green box to post office',
        color: '#6e7f29'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 8, 45),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 9, 0),
        text: 'Quick mtg. with Martin',
        color: '#de3d83'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 9, 30),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 10, 30),
        text: 'Product team mtg.',
        color: '#f67944'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 11, 0),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 11, 30),
        text: 'Stakeholder mtg.',
        color: '#f67944'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 13, 0),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 13, 30),
        text: 'Lunch @ Butcher\'s',
        color: '#00aabb'
    }, {
        start: new Date(now.getFullYear(), now.getMonth(), 8, 15, 0),
        end: new Date(now.getFullYear(), now.getMonth(), 8, 16, 0),
        text: 'General orientation',
        color: '#f67944'
    }, {
        d: (now.getMonth() + 1) + '/14',
        text: 'Dexter BD',
        color: '#37bbe4'
    }, {
        d: (now.getMonth() + 1) + '/5',
        text: 'Luke BD',
        color: '#37bbe4'
    }, {
        d: 'w3',
        text: 'Employment (Semi-weekly)',
        color: '#635045'
    }, {
        d: 'w5',
        text: 'Employment (Semi-weekly)',
        color: '#ff9966'
    }, {
        start: new Date(now.getFullYear(), 1, 7),
        end: new Date(now.getFullYear(), 1, 25),
        text: 'Dean OFF',
        color: '#99ff33'
    }, {
        start: new Date(now.getFullYear(), 2, 5),
        end: new Date(now.getFullYear(), 2, 14),
        text: 'Mike OFF',
        color: '#e7b300'
    }, {
        start: new Date(now.getFullYear(), 4, 7),
        end: new Date(now.getFullYear(), 4, 16),
        text: 'John OFF',
        color: '#669900'
    }, {
        start: new Date(now.getFullYear(), 5, 1),
        end: new Date(now.getFullYear(), 5, 11),
        text: 'Carol OFF',
        color: '#6699ff'
    }, {
        start: new Date(now.getFullYear(), 6, 2),
        end: new Date(now.getFullYear(), 6, 17),
        text: 'Jason OFF',
        color: '#cc9900'
    }, {
        start: new Date(now.getFullYear(), 7, 6),
        end: new Date(now.getFullYear(), 7, 14),
        text: 'Ashley OFF',
        color: '#339966'
    }, {
        start: new Date(now.getFullYear(), 8, 10),
        end: new Date(now.getFullYear(), 8, 20),
        text: 'Marisol OFF',
        color: '#8701a9'
    }, {
        start: new Date(now.getFullYear(), 9, 1),
        end: new Date(now.getFullYear(), 9, 12),
        text: 'Sharon OFF',
        color: '#cc6699'
    }, {
        d: '12/25',
        text: 'Christmas Day',
        color: '#ff0066'
    }, {
        d: '1/1',
        text: 'New Year\'s day',
        color: '#99ccff'
    }, {
        d: '4/1',
        text: 'April Fool\'s Day',
        color: '#ff6666'
    }, {
        d: '11/2',
        text: 'File Form 720 for the third quarter',
        color: '#a63e14'
    }, {
        d: '11/2',
        text: 'File Form 730 and pay tax on wagers accepted during September',
        color: '#a63e14'
    }, {
        d: '11/2',
        text: 'File Form 2290 and pay the tax for vehicles first used during September',
        color: '#a63e14'
    }, {
        d: '11/2',
        text: 'File Form 941 for the third quarter',
        color: '#a63e14'
    }, {
        d: '11/2',
        text: 'Deposit FUTA owed through Sep if more than $500',
        color: '#a63e14'
    }, {
        d: '11/30',
        text: 'Deposit payroll tax for payments on Nov 21-24 if the semiweekly deposit rule applies',
        color: '#a63e14'
    }, {
        d: '11/30',
        text: 'File Form 730 and pay tax on wagers accepted during October',
        color: '#a63e14'
    }, {
        d: '11/30',
        text: 'File Form 2290 and pay the tax for vehicles first used during October',
        color: '#a63e14'
    }]

    });

});
<div id="demo"></div>

Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.

Component license


Purchase component licenses if you are looking for specific funcionality.

Total


All features will be included with the license.

Buy component license

Framework license


Get all 36 components, including with the Framework license.



Mobiscroll for JQuery $595


Use Javascript when building with plain and simple JS. Use jQuery when you have jQuery already included or if you are building with jQuery Mobile. Use AngularJS when building with Angular 1.x or Ionic 1. Use Angular when building with Angular 2/4/5/6/7 or Ionic 2/3/4. Use it when you are building your app or website with React.


Buy framework license
See other licensing options

Framework license


Get all 36 components, including with the Framework license.



Mobiscroll for JQuery $595


  • Use it when building with plain and simple JS
  • Compatible with vanilla JS app or frameworks like Vue
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with jQuery and jQuery Mobile
  • Enjoy the familiar API if you already use jQuery
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular JS and Ionic 1
  • For web and mobile apps based on Angular 1.x
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular 2/4/5/6/7 and Ionic 2/3/4
  • Visual Studio and VS Code integration
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it when building with React JS
  • Collection of UI components for web and mobile
  • Royalty-free commercial usage
  • Technical support is included with the license
Buy framework license
See other licensing options

Framework license


Select the development framework you are using. Get all 36 components with the license.

Mobiscroll for Javascript
Mobiscroll for jQuery
Mobiscroll for React
Mobiscroll for Angular
Mobiscroll for Angular JS
  • Use it when building with plain and simple JS
  • Compatible with vanilla JS app or frameworks like Vue
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with jQuery and jQuery Mobile
  • Enjoy the familiar API if you already use jQuery
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular JS and Ionic 1
  • For web and mobile apps based on Angular 1.x
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular 2/4/5/6/7 and Ionic 2/3/4
  • Visual Studio and VS Code integration
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it when building with React JS
  • Collection of UI components for web and mobile
  • Royalty-free commercial usage
  • Technical support is included with the license
Buy framework license
See other licensing options

Select the framework you are interested in

Javascript
jQuery
Angular
Angular JS
React

Use Javascript when building with plain and simple JS.

Use jQuery when you have jQuery already included or if you are building with jQuery Mobile.

Use AngularJS when building with Angular 1.x or Ionic 1.

Use Angular when building with Angular 2/4/5/6/7 or Ionic 2/3/4.

Use it when you are building your app or website with React.

Do you need additional support seats?

The framework license comes with one support seat. ( +$50/seat )

Add the source code?

Price
Buy now
Customize & try demos locally
Sign in or start your free trial

What framework are you using?

Javascript
jQuery
AngularJS
Angular
Ionic
React
Other
Select a framework
Email address

Customize & try this demo locally
Sign in or start your free trial

We have to set you up with a trial for this to run 👍

Email address

Customize & try demos locally
You can download and use Mobiscroll for Free

What framework are you using?

Javascript
jQuery
AngularJS
Angular
Ionic
React
Other
Select a framework
Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Ionic project

Copy command
$ mobiscroll config ionic
$ mobiscroll config ionic --lite

You will be prompted to log in with your mobiscroll account. Set your password here

Create an Ionic 3 & Mobiscroll starter with the CLI:

$ mobiscroll start ionic myStarter

Run this command for Ionic 4 & Mobiscroll starter:

$ mobiscroll start ionic-angular myStarter

Step 3.Copy the code into your app. HTML goes into the markup, TS into Typescript.

Copy TS
Copy HTML
Copy CSS

Run ionic serve in the root folder of your app 🎉

Copy command
$ ionic serve
Thanks for downloading
Try and customize the app locally

Extract the zip file and run the project like any Ionic app. Make sure to have Ionic CLI installed and open the terminal in the app root folder.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ionic serve

Let us know if we can help and enjoy!

Change your password
Need to update your password? Enter and hit the button below

You are setting a password for the account

New Password Required Enter at least 6 characters
Change your password
Need to update your password? Enter and hit the button below

Your password has been changed!

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

Extract the zip file and open the demo in your favorite browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

Please extract the zip file and run the project like any Angular CLI app. Make sure to have the Angular CLI installed.

For installation and usage, extract the zip file and open a terminal window and follow these steps.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ng serve --open

Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

The easiest way to get started is to follow the installation steps and by grabbing the code directly from the demo page. Let us know if we can help and enjoy!

You'll find a fully functional Kitchen-sink Ionic app in the zip file.

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

The demos are using Babel's in-browser ES6 and JSX transformer. Extract the zip file and open the demo in your browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

Demos
Alerts & notifications
Alert Notifications Note
Components
Alerts & notifications 3
Buttons 4
Calendar 27
Cards 14
Color 10
Date & Time 20
Event Calendar 25
Forms 9
Grid layout 7
Image 7
Inputs & fields 6
Listview 17
Measurement 10
Navigation 8
Number 8
Numpad 13
Option List 4
Popup 10
Range 19
Scroller 7
Scrollview 5
Select 16
Slider & progress 4
Styling 6
Timer 5
Timespan 6
Toggle & Radio 4
Treelist 7
Theme Select
Mobiscroll
Mobiscroll Dark
Material
Material Dark
iOS
iOS Dark
Bootstrap
Windows
Windows Dark
Display Mode
Language Locale
See other demos and change options
Theme
Display
Locale
See other demos