JavaScript calendar

A lightweight responsive JavaScript calendar, date and date-time picker web component plugin. It brings a great user experience across different devices.

  • React, Angular, Vue compatible;
  • Mobile friendly;
  • Date picker;
  • Time picker;
  • Year-month picker;
  • Several events and easy integration;
  • JS plugin or web component;


Webcomponent date picker

How to embed a simple webcomponent calendar input in your application.

<script src=""></script>
<script src=""></script>
<link rel="stylesheet" href="" type="text/css" />

<jsuites-calendar value="2020-01-20"></jsuites-calendar>

document.querySelector('jsuites-calendar').addEventListener('onchange', function(e) {
    console.log('New value: ' +;
document.querySelector('jsuites-calendar').addEventListener('onclose', function(e) {
    console.log('Calendar is closed');

Basic date input

Create a basic date and time input using pure JavaScript.

<script src=""></script>
<link rel="stylesheet" href="" type="text/css" />

<input id='calendar' />

    format: 'DD/MM/YYYY HH:MM',
    time: true,

React integration

Using the JavaScript calendar via NPM.


%npm install jsuites


import jSuites from "jsuites";

import { useRef, useEffect } from "react";
import jSuites from "jsuites";

import "jsuites/dist/jsuites.css";

export default function Calendar({ options }) {
  const calendarRef = useRef(null);

  useEffect(() => {
    jSuites.calendar(calendarRef.current, options);
  }, [options]);

  return <input ref={calendarRef} />;



Method Description;Open the javascript calendar picker
calendar.close(ignoreEvents);Close the calendar
@param int ignoreEvents - Do no execute onclose event
calendar.getValue();Get the current selected date
calendar.setValue(newValue);Set a new value for the javascript calendar and time picker
@param mixed newValue - New date should be set as YYYY-MM-DD HH:MM:SS
calendar.reset();Reset the input value;Go to the next month
calendar.prev();Go to the previous month


Method Description
onchangeTrigger a method when value is changed.
onupdateTrigger a method when any information change in the calendar picker.
oncloseTrigger a method when the calendar is closed.
onopenTrigger a method when the calendar is closed.

Initial settings

Property Description
type: stringPicker type: default | year-month-picker. Default: default
validRange: [ date, date ]Date selection would be disabled out of this range. Default: null
startingDay: numberStarting weekday - 0 for sunday, 6 for saturday. Default: 0 (Sunday)
format: stringDate format. Default: YYYY-MM-DD
readonly: booleanInput will be disabled for manual changes.
today: booleanIf no value is default, open teh calendar on today as default. Default: false
time: booleanInclude a time picker on the calendar. Default: false
resetButton: booleanShow reset button. Default: true
placeholder: stringPlaceholder instructions
months: arrayMonth short names.
Default: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
monthsFull: arrayMonth short names.
Default: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
weekdays: arrayWeekday names.
Default: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
weekdays_short: arrayWeekday short names.
Default: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
value: stringDefault date.
fullscreen: booleanRender in fullscreen. Default: true for screenWidth: 800px
opened: booleanCalendar starts opened. Default: false.
textDone: stringText of the 'Done' button
textReset: stringText of the 'textReset' button
textUpdate: stringText of the 'Update' button

More examples using the calendar plugin