import { default } from "https://deno.land/x/date_fns@v2.22.1/eachMonthOfInterval/index.ts";
Examples
// Each month between 6 February 2014 and 10 August 2014:
var result = eachMonthOfInterval({
start: new Date(2014, 1, 6),
end: new Date(2014, 7, 10)
})
//=> [
// Sat Feb 01 2014 00:00:00,
// Sat Mar 01 2014 00:00:00,
// Tue Apr 01 2014 00:00:00,
// Thu May 01 2014 00:00:00,
// Sun Jun 01 2014 00:00:00,
// Tue Jul 01 2014 00:00:00,
// Fri Aug 01 2014 00:00:00
// ]
// Each month between 6 February 2014 and 10 August 2014: var result = eachMonthOfInterval({ start: new Date(2014, 1, 6), end: new Date(2014, 7, 10) }) //=> [ // Sat Feb 01 2014 00:00:00, // Sat Mar 01 2014 00:00:00, // Tue Apr 01 2014 00:00:00, // Thu May 01 2014 00:00:00, // Sun Jun 01 2014 00:00:00, // Tue Jul 01 2014 00:00:00, // Fri Aug 01 2014 00:00:00 // ]
Parameters
- the interval. See [Interval]https://date-fns.org/docs/Interval