Open Source · Library In development

mx-calendario-fiscal: Mexican Business Days and Tax Due Dates

Zero-dependency TypeScript library for Mexican business days and tax due dates (the 17th, the annual return), with the legal basis and primary source for every date. CFF art. 12, RMF and LFT art. 74.

Role
Design & Development
Year
2026
Published

mx-calendario-fiscal is a TypeScript library with the logic for Mexican business days and tax due dates, with zero runtime dependencies. Every rule and every date carries its legal basis and a link to the primary source. MIT licensed.

Status: the code and tests are on GitHub; it is not published to npm yet.

Why it exists

A Mexican tax deadline is not “the 17th”: it is the 17th, moved to the next business day, and “business day” is defined by three documents that disagree with each other:

  • CFF art. 12 (Federal Tax Code): days that never count (weekends, movable Mondays, May 5, …).
  • RMF rule 2.1.6 (SAT’s annual miscellaneous tax resolution): extra days and general vacation periods the SAT declares non-working. They do not stop the clock for filing returns and paying (CFF 12, par. 2).
  • LFT art. 74 (Federal Labor Law): mandatory rest days for labor purposes. Not the same list: May 5 is non-working for tax purposes but not for labor, and the presidential handover is 1 December in the CFF but 1 October in the LFT.

The library keeps those sets separate and tells you why a day is non-working. The npm packages I found cover only the labor list; none covers CFF 12 + RMF + recurring due dates.

Usage

import { isBusinessDay, nextBusinessDay, addBusinessDays, monthlyDueDate, annualDueDate } from 'mx-calendario-fiscal';

isBusinessDay('2025-11-17');   // false: third Monday of November (CFF art. 12)
nextBusinessDay('2025-11-17'); // '2025-11-18'

// VAT for October 2025: the 17th is a holiday, so it moves to the 18th.
const iva = monthlyDueDate({ obligation: 'iva', period: '2025-10' });
iva.nominal;      // '2025-11-17'
iva.due;          // '2025-11-18'
iva.fundamento;   // ['LIVA art. 5o.-D, último párr.', 'CFF art. 12, párr. 5']

// Annual return, individuals, fiscal year 2025.
annualDueDate({ year: 2025, taxpayer: 'pf' }).due; // '2026-04-30'

// Procedure deadline in business days: SAT vacation (18–31 Jul 2025) does not count.
addBusinessDays('2025-07-17', 1);                         // '2025-08-01'
// For filing and paying, those days are business days.
addBusinessDays('2025-07-17', 1, { purpose: 'filing' });  // '2025-07-18'

What is in the box

  • Business days: isBusinessDay, nextBusinessDay, previousBusinessDay, addBusinessDays and whyNotBusinessDay, with purpose: 'procedure' | 'filing' to tell procedures apart from filing and paying. whyNotBusinessDay returns each reason with its fundamento and source.
  • Due dates: monthlyDueDate (the 17th: ISR provisional payments for companies and individuals, ISR withholdings, VAT and DIOT), annualDueDate (companies 31 March, individuals 30 April) and fiscalCalendar(year) with every due date in the year, sorted. Each result carries the nominal date, the shifted date, the reasons for the shift and the legal basis.
  • Bank-payment Friday rule: with payAtBank: true, if the last day is a Friday and you pay at a bank, the deadline extends to the next business day (CFF art. 12, par. 5).
  • Labor rest days: laborHolidays(year) and isLaborHoliday(date) with LFT art. 74, kept apart from the tax ones.
  • Published vs. projected: RMF data is included through 2026. For later years the library applies the fixed statutory rules and marks results projected: true, because that year’s RMF may still add days or vacation periods. It never invents vacations the SAT has not published.
  • No time zones: dates are YYYY-MM-DD strings; a Date is read by its local calendar components and there is no time-zone arithmetic.
  • Build: ESM and CommonJS, types included, Node ≥ 18.

What it does not do

  • It is not tax or legal advice. It is a support tool: dates depend on laws and resolutions the SAT may change at any time. Check the primary sources or a qualified professional before relying on a date.
  • It does not decide whether you must file, or under which regime (RESICO, bimonthly, etc.).
  • It does not model extra days by the sixth digit of the RFC: I could not confirm that rule in a primary source, so it is excluded.
  • No state, municipal, IMSS or bank calendars, nor contingency extensions the SAT publishes ad hoc.

Tech stack

  • TypeScript, built to ESM and CommonJS with type declarations
  • Node.js ≥ 18, zero runtime dependencies
  • node:test for the suite
  • GitHub Actions for typecheck, tests and publishing to npm via Trusted Publishing with provenance when a vX.Y.Z tag is pushed

Repository

View on GitHub → · To validate a taxpayer’s identifiers there is mx-identifiers.

Goal

So anyone who needs to compute a due date or a deadline in business days does not have to reconcile the CFF, the RMF and the LFT by hand, and every date it returns can be traced back to its legal basis.

07 / Contact

Something similar? Write to me.

Two lines are enough: what you need and what you already have. I'll tell you whether this kind of project fits and what the first step would be.