DayPilot.DatePicker Constructor

The DayPilot.DatePicker constructor creates a date picker instance and initializes it using the supplied configuration object.

Declaration

new DayPilot.DatePicker(options)

Parameters

Example

HTML

<span id="start"></span>
<a href="#" id="change-date">Change</a>

JavaScript

const picker = new DayPilot.DatePicker({
  target: "start",
  pattern: "yyyy-MM-dd",
  onTimeRangeSelected: args => {
    dp.startDate = args.date;
    dp.update();
  }
});

document.getElementById("change-date").addEventListener("click", args => {
  args.preventDefault();
  picker.show();
});

See Also

DayPilot.DatePicker Properties

DayPilot.DatePicker Events

DayPilot.DatePicker Methods

React Calendar with Date Picker [code.daypilot.org]

DayPilot.DatePicker Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript