getMonday()function

getMonday(target?: PossibleDate, caller: AnyCaller = getMonday): Date
ParamType
targetPossibleDate
The date whose week to find Monday for (defaults to "now").
callerAnyCaller
The function to attribute a thrown error to (defaults to getMonday). Defaults to getMonday
Return
Date
A new Date instance at midnight on Monday of the target week.
Throws
RequiredError
If target couldn't be converted to a valid date.

Get a Date representing midnight on Monday of the specified week.

Examples

getMonday("2003-09-12") // Date instance for the Monday of that week at 00:00