npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dhtmlx/calendar

v9.3.4

Published

DHTMLX Calendar – JavaScript date picker and date range selector with timepicker, date highlighting, localization, and customizable UI

Readme

DHTMLX Calendar — JavaScript Date Picker (GPL Edition)

dhtmlx.com npm: v.9.3.4 License: GPL v2

@dhtmlx/calendar is a JavaScript date picker and date range selector component with three navigation views, a built-in timepicker, date highlighting, localization, and fully customizable UI.

It is a framework-agnostic widget that works with plain JavaScript and integrates with React, Angular, Vue, and Svelte.

It is ideal for prototyping, embedding in open-source projects, and evaluating DHTMLX Calendar's core features under the GPL v2 license.

DHTMLX Calendar screenshot


License

This edition of DHTMLX Calendar is licensed under the GNU General Public License v2.0 (GPL v2).

You can redistribute this package and/or modify it under the terms of the GPL v2.

GPL v2 requires that any project using this package also be open source under a GPL-compatible license.

You may NOT use this package in closed-source, proprietary, or commercial applications without a separate commercial license. For commercial use, please obtain a commercial license of DHTMLX Calendar.

This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GPL v2 for more details.

Using DHTMLX Calendar in a commercial or closed-source project?

You need a commercial license. DHTMLX offers Individual, Commercial, Enterprise, and Ultimate license tiers.

Copyright © 2026 XB Software Ltd.


What is DHTMLX Calendar

DHTMLX Calendar is a JavaScript date picker and date range selection widget for web applications. It provides three built-in navigation views (days, months, years), an optional timepicker for time selection, and support for date ranges via two linked calendars. Developers can block or highlight specific dates, configure date formats, set week start day, and fully customize the appearance via CSS.

This is the GPL (open source) edition of DHTMLX Calendar, distributed as the @dhtmlx/calendar npm package. It is part of the DHTMLX Suite family of UI components and can be used standalone or alongside other Suite widgets such as DHTMLX Grid.

Use this GPL edition when you want to prototype with DHTMLX Calendar, integrate it into an open-source project, or evaluate its features before obtaining a commercial license.


Quick Start

Install the package, import the styles, and initialize the calendar in a container element.

Install

npm install @dhtmlx/calendar

Include in your project

import { Calendar } from "@dhtmlx/calendar";
import "@dhtmlx/calendar/calendar.css";

Or via CDN as part of DHTMLX Suite:

<link rel="stylesheet" href="https://cdn.dhtmlx.com/suite/edge/suite.css" />
<script type="text/javascript" src="https://cdn.dhtmlx.com/suite/edge/suite.js"></script>

Or with script tags pointing to local files:

<script src="path/to/calendar.js"></script>
<link rel="stylesheet" href="path/to/calendar.css">

The CSS import is required for default calendar styling and layout.

Initialize

import { Calendar } from "@dhtmlx/calendar";
import "@dhtmlx/calendar/calendar.css";

const calendar = new Calendar("calendar_container", {
    css: "dhx_widget--bordered",
    value: new Date(),
    dateFormat: "%d/%m/%Y",
    weekStart: "monday"
});

Add a container element to your HTML:

<div id="calendar_container"></div>

See a live demo


Basic Usage — DHTMLX Calendar

Date picker attached to an input field

Attach DHTMLX Calendar to a popup and display the selected date in an input field:

<label for="date_input">
    Date
    <input readonly type="text" id="date_input">
</label>
import { Calendar, Popup } from "@dhtmlx/calendar";
import "@dhtmlx/calendar/calendar.css";

const popup = new Popup();

const calendar = new Calendar(null, {
    value: new Date(),
    dateFormat: "%d/%m/%Y",
    weekStart: "monday",
    timePicker: true
});

popup.attach(calendar);

document.getElementById("date_input").addEventListener("click", function(e) {
    popup.show(e.target);
});

calendar.events.on("change", function() {
    document.getElementById("date_input").value = calendar.getValue();
    popup.hide();
});

Date range on a single calendar

Enable range mode to let users select a start and end date on one calendar:

import { Calendar, Popup } from "@dhtmlx/calendar";
import "@dhtmlx/calendar/calendar.css";

const calendar = new Calendar("calendar_container", {
    css: "dhx_widget--bordered",
    range: true,
    value: ["01/06/25", "15/06/25"],
    dateFormat: "%d/%m/%y"
});

// Get the selected range
const [from, to] = calendar.getValue(true); // returns [Date, Date]

Disabled dates

Disable weekends using a function rule:

import { Calendar, Popup } from "@dhtmlx/calendar";
import "@dhtmlx/calendar/calendar.css";

const calendar = new Calendar("calendar_container", {
    css: "dhx_widget--bordered",
    disabledDates: function(date) {
        const day = date.getDay();
        return day === 0 || day === 6; // disable Sunday (0) and Saturday (6)
    }
});

The disabledDates function receives a Date object for each day and returns true to dim and block that date.


DHTMLX Calendar Features

DHTMLX Calendar includes the following features in the GPL edition.

| Feature | Details | | --- | --- | | Three navigation views | Switch between day, month, and year views for fast date navigation | | Date range selection | Place two linked calendars side by side to let users pick a start and end date | | Timepicker | Optional hour/minute selector with 12-hour or 24-hour format | | Date picker mode | Attach the calendar to a popup and display the selected value in an input field | | Disabled dates | Block specific dates or date ranges to prevent selection | | Highlighted dates | Apply custom CSS classes to mark holidays, events, or other special dates | | Date format configuration | Specify any date format string; defaults to %d/%m/%Y | | Week start day | Set the first day of the week to any weekday | | Week numbers | Optionally display ISO week numbers in the calendar grid | | Localization | Built-in support for multiple languages; switch locale at runtime | | Customizable UI | Modify colors, borders, and widths via CSS variables | | Themes and high-contrast mode | Multiple built-in themes including high-contrast for accessibility | | Accessibility | WCAG-compliant; full keyboard navigation support | | Event system | API events for change, dateMouseOver, beforeChange, and more |

This table highlights key features. For the complete and up-to-date feature list, see the DHTMLX Calendar documentation.


Framework Integration

DHTMLX Calendar works with popular front-end frameworks including React, Angular, Vue, and Svelte. These integration guides apply to both the GPL edition and commercial editions of DHTMLX Calendar.


Documentation and Resources