DayPilot.Date.firstDayOfWeek

The firstDayOfWeek() method returns the first day of week for the specified date.

Declaration

DayPilot.Date.firstDayOfWeek([firstDayOfWeek]);
DayPilot.Date.firstDayOfWeek(locale);

Parameters

  • firstDayOfWeek - the first day of week to be used in the calculation (number: 0 = Sunday, 1 = Monday...); if not specified, Sunday will be used
  • locale - DayPilot.Locale object or locale identifier (string); this locale will be used to determine the first day of week

Return Value

DayPilot.Date object representing the first day of week.

Example

var first = new DayPilot.Date("2020-01-08").firstDayOfWeek("en-us");   // new DayPilot.Date("2020-01-05T00:00:00")