Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

setDayOfYear

import { setDayOfYear } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Set the 2nd day of the year to 2 July 2014:
const result = setDayOfYear(new Date(2014, 6, 2), 2)
//=> Thu Jan 02 2014 00:00:00
function setDayOfYear<DateType extends Date>(date: DateType | number | string, dayOfYear: number): DateType;
§
setDayOfYear<DateType extends Date>(date: DateType | number | string, dayOfYear: number): DateType
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The date to be changed
§
dayOfYear: number
[src]
  • The day of the year of the new date

§Return Type

§
DateType
[src]

The new date with the day of the year set