The pattern property (string) sets the date format used when displaying the selected date in the target element.

Declaration

DayPilot.DatePicker.pattern

Default Value

datePattern value of the selected locale ("M/d/yyyy").

Notes

See DayPilot.Date.toString() for supported pattern elements.

For an input target, this pattern is also used to parse typed dates as the user types. Choose a pattern users can follow, such as yyyy-MM-dd for an input displaying 2027-10-08. See the DatePicker example.

Example

const picker = new DayPilot.DatePicker({
  target: "start",
  pattern: "dd.MM.yyyy",
  // ...
});
picker.show();

See Also

DayPilot.DatePicker.target

DayPilot.Date.toString()

DayPilot.Locale.datePattern

DayPilot.DatePicker.locale

DayPilot.DatePicker Class

Availability

Availability of this API item in DayPilot editions:

ProductLitePro
DayPilot for JavaScript