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

eachWeekendOfYear

import { eachWeekendOfYear } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Lists all Saturdays and Sundays in the year
const result = eachWeekendOfYear(new Date(2020, 1, 1))
//=> [
//   Sat Jan 03 2020 00:00:00,
//   Sun Jan 04 2020 00:00:00,
//   ...
//   Sun Dec 27 2020 00:00:00
// ]
]
function eachWeekendOfYear<DateType extends Date>(date: DateType | number | string): DateType[];
§
eachWeekendOfYear<DateType extends Date>(date: DateType | number | string): DateType[]
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The given year

§Return Type

§
DateType[]
[src]

An array containing all the Saturdays and Sundays