Skip to main content
Deno 2 is finally here 🎉️
Learn more
Very Popular
Go to Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.0/eachWeekOfInterval/index.ts";

Examples

// Each week within interval 6 October 2014 - 23 November 2014: var 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 // ]

Parameters

dirtyInterval: Interval
optional
options: WeekStartOptions

Returns

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