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

Function toDate

pkgs/core/src/toDate/index.ts:42–51  ·  view source on GitHub ↗
(
  argument: DateArg<DateType>,
  context?: ContextFn<ResultDate> | undefined,
)

Source from the content-addressed store, hash-verified

40 * //=> Tue Feb 11 2014 11:30:30
41 */
42export function toDate<
43 DateType extends Date | ConstructableDate,
44 ResultDate extends Date = DateType,
45>(
46 argument: DateArg<DateType>,
47 context?: ContextFn<ResultDate> | undefined,
48): ResultDate {
49 // [TODO] Get rid of `toDate` or `constructFrom`?
50 return constructFrom(context || argument, argument);
51}

Callers 15

startOfQuarterFunction · 0.90
addDaysFunction · 0.90
test.tsFile · 0.90
isWeekendFunction · 0.90
isTuesdayFunction · 0.90
getWeekFunction · 0.90
startOfDecadeFunction · 0.90
setQuarterFunction · 0.90
setHoursFunction · 0.90
toTpInstantFunction · 0.90
isLastDayOfMonthFunction · 0.90

Calls 1

constructFromFunction · 0.90

Tested by

no test coverage detected