The DayPilot.DatePicker constructor creates a date picker instance and initializes it using the supplied configuration object.
Declaration
new DayPilot.DatePicker(options)Parameters
options(object) - configuration object that holds DayPilot.DatePicker Properties and DayPilot.DatePicker Events used to initialize the instance
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
React Calendar with Date Picker [code.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot