The firstDayOfWeek() method returns the first day of the week for the specified date.
Declaration
DayPilot.Date.firstDayOfWeek()
DayPilot.Date.firstDayOfWeek(firstDayOfWeek)
DayPilot.Date.firstDayOfWeek(locale)Parameters
firstDayOfWeek(number) - first day of the week to use in the calculation;0= Sunday,1= Monday; if not specified, Sunday is usedlocale(DayPilot.Locale | string) - locale object or locale identifier used to determine the first day of the week
Return Value
Returns a DayPilot.Date object representing the first day of the week.
Example
const first = new DayPilot.Date("2020-01-08").firstDayOfWeek("en-us"); // new DayPilot.Date("2020-01-05T00:00:00")See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot