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

eachWeekOfInterval

import { eachWeekOfInterval } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Each week within interval 6 October 2014 - 23 November 2014:
const result = eachWeekOfInterval({
  start: new Date(2014, 9, 6),
  end: new Date(2014, 10, 23)
})
//=> [
//   Sun Oct 05 2014 00:00:00,
//   Sun Oct 12 2014 00:00:00,
//   Sun Oct 19 2014 00:00:00,
//   Sun Oct 26 2014 00:00:00,
//   Sun Nov 02 2014 00:00:00,
//   Sun Nov 09 2014 00:00:00,
//   Sun Nov 16 2014 00:00:00,
//   Sun Nov 23 2014 00:00:00
// ]
function eachWeekOfInterval<DateType extends Date>(interval: Interval<DateType>, options?: EachWeekOfIntervalOptions): DateType[];
§
eachWeekOfInterval<DateType extends Date>(interval: Interval<DateType>, options?: EachWeekOfIntervalOptions): DateType[]
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
interval: Interval<DateType>
[src]
  • The interval.
§
  • An object with options.

§Return Type

§
DateType[]
[src]

The array with starts of weeks from the week of the interval start to the week of the interval end