Disclosure: I write the PortalFone guide for Mexican federalized teachers (Mi Portal FONE). This post is about a small, practical data problem: turning a government pay calendar into dates a program can actually use.
The calendar is a table, not a list of dates
Mexico's federalized teachers are paid by quincena — twice a month, 24 pay periods a year. The official calendar (the Anexo IX published by DGSANEF, the federalized payroll administrator) lists each quincena with a dispersion date: the day the money is actually sent. A quincena labelled "23" does not mean the 23rd of a month; it means the 23rd pay period of the year, covering roughly the second half of November.
So the first modelling decision is to treat every row as a record with four fields: year, quincena number (1–24), period start, period end, and dispersion date. The dispersion date is the one teachers actually care about, and it is usually a working day a few days before or after the period ends.
Parsing rules that actually matter
- Quincena numbers are not dates. Never derive a payment date from the quincena number alone; always look it up in the calendar table.
- Dispersion can move. The Anexo IX itself warns that dates can change for operational reasons. A good implementation stores the calendar as data (a JSON table keyed by quincena) and re-checks the source, rather than hard-coding dates into the UI.
- Two payments share the calendar. The aguinaldo (year-end bonus) is paid in two parts — the first in November, the second in January — and both appear in the same calendar. If your code assumes one payment per quincena, the January part will look like a duplicate.
- Holidays shift things. When a dispersion date falls on a weekend or holiday, the payment moves to the nearest working day. That is a business rule, not a calendar bug, and it belongs in a small function with a holiday list, not scattered through the UI.
A tiny example
// quincena -> dispersion date (from the Anexo IX 2026 table) const calendar2026 = { 23: new Date('2026-12-11'), // quincena 23 disperses 11 Dec 24: new Date('2026-12-14'), // quincena 24 disperses 14 Dec }; function nextPayment(from = new Date()) { const entries = Object.entries(calendar2026) .map(([q, d]) => ({ quincena: Number(q), date: d })) .filter(e => e.date >= from) .sort((a, b) => a.date - b.date); return entries[0] ?? null; } The point is not the snippet — it is that a pay calendar is data with rules, and once it is data, everything else (reminders, countdowns, "when do I get paid?" answers) becomes a lookup.
You can see the full 2026 table explained for teachers in the PortalFone pay calendar guide, and the wider guide on the PortalFone home page.
Takeaway
Model the calendar, don't hard-code it: quincena number, period, dispersion date, and the rules that move dates. Then the same table powers the calendar view, the reminders and the answers — and when the official calendar changes, you change one table, not the whole app.
