One of the world's easiest, most powerful, and full responsive JavaScript Calendars!
v2.3.0
- Zero-dependencies!
- Adding, updating, and removing events, with full custom colors support.
- Full API available via public functions.
- Drag and Drop for events, even across multiple Calendars!
- Drag and Drop for moving events to new times, and resizing to adjust event durations (only in Full Day view).
- Cut, Copy, Paste (with multi-select support), and Duplication of events.
- Configurable text for translations.
- Day, Week, Month, and All Events views.
- Fully styled in CSS/SASS (including the buttons) and compatible with the Bootstrap library.
- Full CSS color themes support (using :root variables).
- Custom triggers for actions (adding/updating/removing events, skipping months, etc).
- Export to CSV, XML, JSON, TEXT, iCAL, MD, HTML, and TSV, with system clipboard setting support.
- Full-screen mode (double clicking the title bar).
- Search support (with search history).
- Repeat every Day, Week, Month, Year, or a custom period (with exclusion days support).
- Customizable holidays.
- Shortcut keys (click here to see the full list).
- Custom event groups (with configurable toggles via the side menu).
- Browser notifications for events (modern browsers only).
- Drop file support (allowing a file containing JSON, or an array of events, to be added).
- DatePicker mode (just assign to the ID of an text input).
- HTML text support (off by default).
- jQuery plugin for quickly creating Calendars.
- Data-Binding support to quickly create new Calendars without writing Javascript!
- Popup notifications for actions (adding/updating/deleting events, updating configuration, etc).
- Start of week support (Monday, Saturday, or Sunday).
- Local storage support for events!
All modern browsers (such as Google Chrome, FireFox, and Opera) are fully supported.
Limited support is still available for Internet Explorer. However, use within this browser is not recommended.
To see a list of all the most recent changes, click here.
To get started using Calendar.js, do the following steps:
Make sure you include the "DOCTYPE html" tag at the top of your email, as follows:
<!DOCTYPE html>
<link rel="stylesheet" href="dist/calendar.js.css" />
<script src="dist/calendar.js"></script>
<div id="calendar"></div>
<script>
var calendarInstance1 = calendarJs( "calendar", {
manualEditingEnabled: true
// All your options can be set here
} );
// OR
var calendarElement = document.getElementById( "calendar" );
var calendarInstance2 = calendarJs( calendarElement, {
manualEditingEnabled: true
// All your options can be set here
} );
</script>
To see the options available for the class constructor, click here. You can also create new Calendars using the jQuery Plugin, or by using Data Bindings. See the test HTML files for examples.
That's it! Nice and simple. Please refer to the code if you need more help (fully documented).
To customize, and get more out of Calendar.js, please read through following documentation.
Options (which can be set when initializing, or afterwards) allow you to customize how Calendar.js will look and function. The options are also used to set the custom triggers you want to fire when specific actions occur. You can set them manually as follows:
<script>
calendarInstance.setOptions( {
manualEditingEnabled: false,
maximumEventsPerDayDisplay: 0,
visibleDays: [ 0, 1, 2, 3, 4 ]
} );
</script>
To see a list of all the available options you can use, click here.
To see a list of all the available custom triggers you can use, click here.
An event is defined as a JavaScript object, as follows:
<script>
var event = {
from: new Date(),
to: new Date(),
title: "A New Event",
description: "A description of the event"
};
</script>
You can add a new event by using one of the add public functions, as follows:
<script>
calendarInstance.addEvent( event );
</script>
To see a list of all the available event properties and how they should be formatted, click here.
A holiday is a piece of text that is shown under the day number in the month it is assigned to. You can set these holidays in the options, or add them manually as follows:
<script>
var holiday1 = {
day: today.getDate(),
month: today.getMonth() + 1,
title: "A New Holiday",
};
// This is a public function that you can call
calendarInstance.addHolidays( [ holiday1 ] );
</script>
To see a list of all the available holiday properties and how they should be formatted, click here.
To see a list of all the public functions available, click here.
Search Options allow you to customize how Calendar.js Search dialog will function. You can set them manually as follows:
<script>
calendarInstance.setSearchOptions( {
matchCase: false
} );
</script>
To see a list of all the available search options you can use, click here.