MCPcopy
hub / github.com/date-fns/date-fns / startOfMonth

Function startOfMonth

pkgs/core/src/startOfMonth/index.ts:34–45  ·  view source on GitHub ↗
(
  date: DateArg<DateType>,
  options?: StartOfMonthOptions<ResultDate> | undefined,
)

Source from the content-addressed store, hash-verified

32 * //=> Mon Sep 01 2014 00:00:00
33 */
34export function startOfMonth<
35 DateType extends Date,
36 ResultDate extends Date = DateType,
37>(
38 date: DateArg<DateType>,
39 options?: StartOfMonthOptions<ResultDate> | undefined,
40): ResultDate {
41 const _date = toDate(date, options?.in);
42 _date.setDate(1);
43 _date.setHours(0, 0, 0, 0);
44 return _date;
45}

Callers 4

test.tsFile · 0.90
getWeeksInMonthFunction · 0.90
eachWeekendOfMonthFunction · 0.90
getWeekOfMonthFunction · 0.90

Calls 1

toDateFunction · 0.90

Tested by

no test coverage detected