williamtroup / Calendar.js

📅 A javascript drag & drop event calendar, that is fully responsive and compatible with all modern browsers.
https://calendar-js.com
MIT License
478 stars 33 forks source link
calendar calendar-events daily datepicker-dialog frontend fullcalendar javascript monthly schedule task timeline weekly widget yearly

Calendar.js [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Calendar.js%2C%20a%20free%20JavaScript%20library&url=https://github.com/williamtroup/Calendar.js&hashtags=calendar,javascript,responsive,events) [![npm](https://img.shields.io/badge/npmjs-v2.12.0-blue)](https://www.npmjs.com/package/jcalendar.js) [![nuget](https://img.shields.io/badge/nuget-v2.12.0-purple)](https://www.nuget.org/packages/jCalendar.js/) [![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Calendar.js/blob/main/LICENSE.txt) [![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Calendar.js/discussions) [![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-white)](https://www.william-troup.com/)

📅 One of the world's easiest, most powerful, and fully responsive JavaScript Calendars!

v2.12.0


What views does Calendar.js support?

Calendar.js supports 8 different views (two are modes), which can be accessed from the context menus, and title bar buttons. They are as follows:

1. Full Month (default view)

CalendarJs CalendarJs - Menu CalendarJs - Pin-Up

2. Full Day

CalendarJs - Full Day

3. Full Week

CalendarJs - Full Week

4. Full Year

CalendarJs - Full Year

5. All Events

CalendarJs - All Events

6. Timeline

CalendarJs - All Events

7. Date Picker Mode

CalendarJs - Date-Picker

8. Widget Mode

CalendarJs - Widget



What features does Calendar.js have?

Where can I find the documentation?

All the documentation can be found here.

What browsers are supported?

All modern browsers (such as Google Chrome, FireFox, and Opera) are fully supported.

What languages are supported?

What are the most recent changes?

To see a list of all the most recent changes, click here.

How do I install Calendar.js?

You can install the library with npm into your local modules directory using the following command:

npm install jcalendar.js

Or, you can download the latest zipped up version here.

How do I get started?

To get started using Calendar.js, do the following steps:

1. Prerequisites:

Make sure you include the "DOCTYPE html" tag at the top of your email, as follows:

<!DOCTYPE html>


2. Include Files:

<link rel="stylesheet" href="https://github.com/williamtroup/Calendar.js/blob/main/dist/calendar.js.css">
<script src="https://github.com/williamtroup/Calendar.js/raw/main/dist/calendar.js"></script>


3. Create DOM Container:

<div id="calendar"></div>


4. Initialize Calendar.Js:

<script> 
  var calendarInstance1 = new calendarJs( "calendar", {
    manualEditingEnabled: true
    // All your options can be set here
  } );

  // OR
  var calendarElement = document.getElementById( "calendar" );
  var calendarInstance2 = new calendarJs( calendarElement, {
    manualEditingEnabled: true
    // All your options can be set here
  } ); 
</script>



5. Finishing Up:

That's it! Nice and simple. Please refer to the code if you need more help (fully documented).

How do I go about customizing Calendar.js and add events?

To customize, and get more out of Calendar.js, please read through the following documentation.

1. Options:

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,
      views: {
          fullMonth: {
              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.

2. Event Object Format:

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.

3. Holiday Object Format:

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 holiday = {
      day: today.getDate(),
      month: today.getMonth() + 1,
      title: "A New Holiday",
  };

  // This is a public function that you can call
  calendarInstance.addHolidays( [ holiday ] );
</script>

To see a list of all the available holiday properties and how they should be formatted, click here.

4. Public Functions:

To see a list of all the public functions available, click here.

5. Search Options:

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.