Most products with deadlines end up sending reminders: "your invoice is due in 3 days", "the filing deadline is tomorrow". The naive version subtracts days from the due date — and sends a reminder on a Sunday, or on Christmas, or two reminders on the same day.

This is the last part of the series. Let's build a reminder schedule that respects business days.

The setup

A monthly deadline on the 20th, moved to the next business day when needed, with two holidays:

import { createCalendar, occurrences, reminderDates } from '@contalert/duedates'; const calendar = createCalendar({ holidays: ['2026-12-25', '2027-01-01'] }); const deadlines = occurrences( { type: 'dayOfMonth', day: 20, adjust: 'following' }, { from: '2026-11-01', count: 3, calendar }, ); // [ // { nominal: '2026-11-20', due: '2026-11-20' }, // { nominal: '2026-12-20', due: '2026-12-21' }, ← Sunday moved to Monday // { nominal: '2027-01-20', due: '2027-01-20' }, // ] 

Reminders in business days

Remind 5 business days before, 1 business day before, and on the day:

for (const { due } of deadlines) { console.log(due, reminderDates(due, [5, 1, 0], { calendar })); } // 2026-11-20 ['2026-11-13', '2026-11-19', '2026-11-20'] // 2026-12-21 ['2026-12-14', '2026-12-18', '2026-12-21'] // 2027-01-20 ['2027-01-13', '2027-01-19', '2027-01-20'] 

Look at December: the deadline is Monday the 21st, so "1 business day before" is Friday the 18th, not Sunday the 20th.

Compare with counting calendar days:

reminderDates('2026-12-21', [7, 1], { unit: 'calendarDays' }); // ['2026-12-14', '2026-12-20'] ← the second reminder lands on a Sunday 

Holidays in the middle

Around the end of the year, holidays and weekends pile up. For a deadline on Monday, December 28:

reminderDates('2026-12-28', [1, 2], { calendar }); // ['2026-12-23', '2026-12-24'] 

"1 business day before" skips the weekend and Christmas, landing on December 24.

Duplicates are removed

When offsets collapse to the same date, you get one reminder, not two. The result is always sorted, so you can store it as is.

Adjust the deadline, not the reminder

Notice the order of operations: first compute the due date with the right convention, then count back from it. If you count back from the nominal date (December 20, a Sunday) you get reminders that are a day early and anchored to a day nobody works.

The same applies to rules that land on holidays. "Last Friday of the month" in December 2026 is Christmas:

occurrences({ type: 'weekdayOfMonth', weekday: 5, nth: -1 }, { from: '2026-12-01', count: 1, calendar }); // [{ nominal: '2026-12-25', due: '2026-12-25' }] ← no adjustment configured occurrences( { type: 'weekdayOfMonth', weekday: 5, nth: -1, adjust: 'preceding' }, { from: '2026-12-01', count: 1, calendar }, ); // [{ nominal: '2026-12-25', due: '2026-12-24' }] 

Without an adjust, the rule happily returns a holiday. Always decide what should happen.

Sending them at a sensible hour

Reminder dates are calendar days. To actually send them, pick a local time in the recipient's time zone — 09:00 is a good default — and compare with their wall clock:

import { today } from '@contalert/duedates'; const reminders = reminderDates('2026-12-21', [5, 1, 0], { calendar }); if (reminders.includes(today('America/New_York'))) { // queue the email for 09:00 New York time } 

Series recap

Over five articles we covered:

  1. Why most due-date logic is wrong — the four classic bugs.
  2. SLA deadlines in business hours, with breaks and holidays.
  3. JavaScript Date, time zones and DST.
  4. Business days around the world.
  5. And today: reminder schedules.

All the examples use duedates, an MIT-licensed TypeScript library with zero dependencies. Issues and ideas are welcome — especially the edge cases from your own systems.

npm install @contalert/duedates