Every Friday, the owner of a small bookkeeping firm does the same chore. Open each client invoice, find the date it went out, add 30 days on a calendar, and count how many days are left. It takes a while, and every so often a late invoice slips past because someone counted wrong.
That chore is just date math. JavaScript treats a date as a number underneath, so it can add 30 days and count the days between two dates with no calendar at all. Three small functions turn a list of invoice dates into a reminder list.
This is the code from my free lesson. You can run all of it in JSFiddle (no account needed).
The page: a heading and an empty list
In JSFiddle's HTML panel:
<h3> Invoice reminders </h3> <ul id= "list" ></ul>
Enter fullscreen mode
Exit fullscreen mode
JavaScript will fill that empty list.
Today, and where the list is
In the JavaScript panel:
const today = new Date ( ' 2026-10-24T00:00 ' ); const list = document .…