Calendar

The Calendar is a widget that displays a calendar and allows an end user to select the required date within a specified date range.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/calendar
Calendar interactive configuration
Copy Code
Copy to Codepen
$("#calendar").dxCalendar({
});

You can create the widget using one of the following approaches.

  • jQuery
    Use the dxCalendar jQuery plug-in.

    HTML
    <div id="calendar"></div>
    JavaScript
    $("#calendar").dxCalendar({
        min: new Date(2000,1,1),
        max: new Date(2029,12,31),
        firstDayOfWeek: 0
    });
  • Knockout
    Add a div element and apply the dxCalendar binding to this element.

    HTML
    <div data-bind="dxCalendar: {
        min: new Date(2000,1,1),
        max: new Date(2029,12,31),
        firstDayOfWeek: 0
    }"></div>
  • AngularJS
    Add a div element and apply the dx-calendar directive to this element.

    HTML
    <div dx-calendar="{
        min: new Date(2000,1,1),
        max: new Date(2029,12,31),
        firstDayOfWeek: 0
    }"></div>

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

You can find the detailed information on principles of working with the widget in the dxCalendar section of the Editor Widgets article.

View Demo

Watch Video

Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the Calendar widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.

Default Cell Template

This section lists the fields that are used in a default template for calendar cells.

By default, a predefined cell template is applied to display calendar cells. This template is based on certain fields of an object holding cell information. Below is the list of these fields. If the default cell template is not appropriate for your task, implement a custom cell template based on these fields.

See Also