getMonthStart()function

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

Get a Date representing midnight on the first day of the specified month.

Examples

getMonthStart("2003-09-12") // Date instance for 2003-09-01 at 00:00