DayPilot.Date.fromYearMonthDay

The fromYearMonthDay() method returns a DayPilot.Date instance representing the specified day.

Declaration

DayPilot.Date.fromYearMonthDay(year[, month, [day]])

Parameters

  • year (number) - year

  • month (number) - month; optional, defaults to 1 if not specified

  • day (number) - day of the month; optional, defaults to 1 if not specified

Return Value

Returns a DayPilot.Date instance representing the specified day.

Notes

This is a static method.

Example

const day1 = DayPilot.Date.fromYearMonthDay(2016);  // 2016-01-01
const day2 = DayPilot.Date.fromYearMonthDay(2016, 2);  // 2016-02-01
const day3 = DayPilot.Date.fromYearMonthDay(2016, 2, 29);  // 2016-02-29

See Also

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript