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

eachMonthOfInterval

import { eachMonthOfInterval } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Each month between 6 February 2014 and 10 August 2014:
const 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
// ]
function eachMonthOfInterval<DateType extends Date>(interval: Interval<DateType>, options?: EachMonthOfIntervalOptions): DateType[];
§
eachMonthOfInterval<DateType extends Date>(interval: Interval<DateType>, options?: EachMonthOfIntervalOptions): DateType[]
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
interval: Interval<DateType>
[src]
  • The interval

§Return Type

§
DateType[]
[src]

The array with starts of months from the month of the interval start to the month of the interval end