- Information
- License (MIT)
- Recent Changes
- Supported Languages
- Supported Export Types
- Supported Import Types
- Setup
- Getting Started
- CDN Links
- JSON Objects
- Calendar Event
- Holiday
- Navigation
- Shortcut Keys
- API
- Binding Functions
- Class Instance Functions
- Advanced
- Custom Triggers
- Basic Options
- View Options
- Search Options
- Text Options
- Date Formatting
Getting Started
Learn how to prepare your HTML page for Calendar.js. This guide explains how to add the necessary script tags, link stylesheets, and structure your markup so you can seamlessly integrate Calendar.js and display fully interactive calendars on your website.
Before proceeding, ensure that Calendar.js is installed or downloaded and properly set up in your project.
Prerequisites
Make sure you include the "DOCTYPE html" tag at the top of your HTML, as follows:
<!DOCTYPE html>
Include CSS File
Include the following CSS file:
<link rel="stylesheet" href="dist/calendar.js.css">
Include JS File
Include the following JavaScript file:
<script src="dist/calendar.js"></script>
Create DOM Element
Add a new DOM element to house the Calendar.js instance:
<div id="calendar"></div>
Create Calendar.js Instance
Run the following JavaScript to create a new Calendar.js instance:
const calendarInstance = new calendarJs( "calendar" );