Overview
Introduction
Building a list of recurring dates by hand, every other Tuesday, the first of each month, a date every ten days, gets tedious fast and is easy to get wrong around month boundaries.
This tool generates that sequence for you: give it a start date, a step, and a count, and it produces the full list in one pass.
What Is Generate Custom Dates?
A custom calendar date generator that takes a start date, a step expressed as a number and a unit (days, weeks, months, or years), and a count, then outputs that many dates in YYYY-MM-DD form, one per line.
It handles day- and week-based steps with simple day-count arithmetic, and month- and year-based steps with calendar-aware month arithmetic that clamps overflowing day-of-month values.
How Generate Custom Dates Works
The start date is parsed strictly as YYYY-MM-DD and validated as a real calendar date. The step line is parsed into an amount and a unit, with weeks converted to an equivalent number of days and years converted to an equivalent number of months.
For day-based steps, each date is computed by adding a multiple of the step to the start date's epoch-day count. For month-based steps, each date is computed by advancing the calendar month directly and clamping the day of month to the target month's length when needed.
When To Use Generate Custom Dates
Use it to build a list of recurring dates for a schedule, billing cycle, or reminder series, like every 2 weeks or the 15th of every month.
It's also useful for generating test data or fixtures that need a realistic, evenly spaced run of calendar dates.
Often used alongside Generate a Date Sequence, Sort Calendar Dates and Validate a Calendar Date.
Features
Advantages
- Correctly clamps day-of-month overflow on month and year steps instead of producing invalid dates like February 31st.
- Supports four different step units, days, weeks, months, and years, from a single compact input format.
- Generates up to 1000 dates in one batch, well beyond what's practical to type by hand.
Limitations
- Caps out at 1000 dates per run; larger sequences need to be split across multiple batches.
- Month-based steps that clamp the day of month can drift the day-of-month value over a long sequence, for example a monthly step starting on the 31st will land on shorter months' last day, not always the 31st.
Examples
Best Practices & Notes
Best Practices
- For monthly or yearly recurring schedules where the exact day of month matters most months, start from a day near the beginning of the month to avoid repeated clamping on shorter months.
- Use a day- or week-based step instead of a month-based one when you need a perfectly even day-count gap between every date, since month steps can vary in actual day length.
Developer Notes
Day and week steps use `epochDayFromDate` and `dateFromEpochDay` helpers built on `Date.UTC(...) / 86400000`, so every date lands exactly N whole days apart regardless of calendar irregularities. Month and year steps use an `addMonths` helper that computes `totalMonths = (start.month - 1) + months`, derives year and month from it, then clamps `day` to `Math.min(start.day, daysInMonth(year, month))`.
Generate Custom Dates Use Cases
- Generating a recurring billing or invoice date schedule
- Building a list of reminder or check-in dates spaced a fixed interval apart
- Producing realistic date sequences for test fixtures or sample data
Common Mistakes
- Assuming a monthly step always preserves the exact day of month; a step that starts on the 31st will clamp down on any month shorter than 31 days.
- Requesting more than 1000 dates in a single run, which is rejected; split large sequences into multiple batches instead.
Tips
- If a monthly sequence needs to stay locked to the last day of each month regardless of length, start the sequence from the last day of the first month rather than a fixed day like the 31st.
- Combine week-based steps with a small count to quickly sanity-check a biweekly or triweekly schedule before committing to it elsewhere.