DayPilot.Date.fromYearMonthDay

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

Note that this is a "static" method.

Declaration

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

Parameters

  • year (number) - year
  • month (number) - month (optional; if not specified, 1 will be used)
  • day (number) - day of month (optional; if not specified, 1 will be used)

Example

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