~/recurring-dates
docs

Monthly Frequency

Generate dates on specific days of the month. Perfect for pay days, billing cycles, and monthly reports.

Single Day

const result = generateRecurringDates({
  STARTS_ON: "01-01-2025",
  ENDS_ON: "31-06-2025",
  FREQUENCY: "M",
  MONTH_DATES: [15],
});

// text: "Every month on 15th"
// dates: ["15-01-2025", "15-02-2025", ..., "15-06-2025"]

Multiple Days

Common pattern for bi-monthly pay:

const result = generateRecurringDates({
  STARTS_ON: "01-01-2025",
  ENDS_ON: "31-12-2025",
  FREQUENCY: "M",
  MONTH_DATES: [1, 15],
});

// text: "Every month on 1st and 15th"

Every N Months

Use INTERVAL to skip months. Quarterly on the 1st:

const result = generateRecurringDates({
  STARTS_ON: "01-01-2025",
  ENDS_ON: "31-12-2025",
  FREQUENCY: "M",
  MONTH_DATES: [1],
  INTERVAL: 3,
});

// text: "Every 3 months on 1st"
// dates: ["01-01-2025", "01-04-2025", "01-07-2025", "01-10-2025"]

Multiple Dates per Month

You can specify as many days as you need:

const result = generateRecurringDates({
  STARTS_ON: "01-01-2025",
  ENDS_ON: "28-02-2025",
  FREQUENCY: "M",
  MONTH_DATES: [5, 10, 20, 25],
});

// text: "Every month on 5th, 10th, 20th and 25th"

Config Keys Used

STARTS_ON, ENDS_ON, FREQUENCY: "M", MONTH_DATES, INTERVAL, EXCLUDE_DATES, FORMAT.