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

Function getDayOfYear

pkgs/core/src/getDayOfYear/index.ts:29–37  ·  view source on GitHub ↗
(
  date: DateArg<Date> & {},
  options?: GetDayOfYearOptions | undefined,
)

Source from the content-addressed store, hash-verified

27 * //=> 183
28 */
29export function getDayOfYear(
30 date: DateArg<Date> & {},
31 options?: GetDayOfYearOptions | undefined,
32): number {
33 const _date = toDate(date, options?.in);
34 const diff = differenceInCalendarDays(_date, startOfYear(_date));
35 const dayOfYear = diff + 1;
36 return dayOfYear;
37}

Callers 3

index.tsFile · 0.90
test.tsFile · 0.90
_testFunction · 0.90

Calls 3

toDateFunction · 0.90
differenceInCalendarDaysFunction · 0.90
startOfYearFunction · 0.90

Tested by

no test coverage detected