# date-fns/date-fns — codebase unpack

> Canonical page: https://codevetter.com/unpack/date-fns

This is a deterministic Repo Unpack scan of date-fns/date-fns — a structural map, not a review, security audit, or maintainer-endorsed description.

- Scanned commit: 717ce0a807ea4c6b540d015b5c408723175b2838 (2026-09-22)
- Last upstream commit: Add Temporal docs, tests and code for `endOfDay`, `endOfDecade`, `endOfHour`, `endOfISOWeek`, `endOfISOWeekYear`, `endOfMinute` and `endOfMonth`
- Generated by codevetter 1.15.0 on 2026-10-02
- 2020 files scanned · 10.3 MB

Source inspection; upstream code and tests were not executed.

## Languages

- TypeScript: 1721 files
- Markdown: 126 files
- JSON: 54 files
- JavaScript: 47 files
- TOML: 26 files
- Shell: 14 files
- YAML: 11 files
- CSS: 2 files

## Repository structure

- pkgs/ — 1990 files
- .github/ — 8 files
- .devcontainer/ — 5 files
- .agents/ — 1 files
- codemods/ — 1 files
- .opencode/ — 1 files

Probable source entrypoint: `pkgs/` (inferred from the tree, not upstream docs)

## Source layout — pkgs/

- pkgs/core/ — 260 files

## Package

- package.json: @date-fns/root v0.0.0 — 5 declared dependencies

## Structural health signals

Average score 7.7/10 across 96 files; 5 hotspots. These are deterministic review leads, not proof of a bug.

## Recent history

- 717ce0a807ea (2026-09-22) Add Temporal docs, tests and code for `endOfDay`, `endOfDecade`, `endOfHour`, `endOfISOWeek`, `endOfISOWeekYear`, `endOfMinute` and `endOfMonth`
- bb87ba5de482 (2026-09-22) Add Temporal docs, tests and code for `eachWeekendOfInterval`, `eachWeekendOfMonth`, `eachWeekendOfYear`, `eachYearOfInterval`, `setDate`, `setMonth` and `startOfQuarter`
- 766dea98b704 (2026-09-22) Fix tpStartOfISOWeekYear to return `Temporal.ZonedDateTime` when possible
- 21006241cf39 (2026-09-22) Upgrade dev env
- a2819a71ee22 (2026-09-22) Add Temporal docs, tests and code for `differenceInISOWeekYears`, `differenceInMilliseconds`, `differenceInMinutes`, `differenceInMonths`, `differenceInQuarters`, `differenceInSeco

## Overview

date-fns is a modular JavaScript and TypeScript date utility library for browser and Node.js developers, with APIs for calendar arithmetic, parsing, formatting, intervals, comparisons, and localization. Its distinctive integration mechanism preserves native Date subclasses and accepts explicit calculation contexts, allowing the companion TZDate and UTCDate packages to control time-zone behavior. This monorepo also contains package generators, compatibility examples, and a separate Firebase-backed documentation publisher. The brief reflects read-only investigation at commit 717ce0a807ea4c6b540d015b5c408723175b2838; inspected tests provide coverage evidence, not passing results.

## System map

The repository separates date calculation, date subclasses, documentation publishing, and development tooling into workspace packages. Consumers enter through exported functions and classes rather than a central application startup routine. Core package output supports both ESM and CommonJS, while workspace exports reference source files. Persistent storage appears in the documentation publisher; the inspected calculation paths operate on in-memory dates and options.
- pnpm-workspace.yaml includes pkgs/* and the time-zone engine-test package; root TypeScript references core, docs, utc, tz, and engine tests. — [pnpm-workspace.yaml#L1-L3](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pnpm-workspace.yaml#L1-L3) [tsconfig.json#L1-L10](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/tsconfig.json#L1-L10)
- The core export surface includes independent arithmetic, difference, interval, formatting, parsing, predicate, and boundary functions, plus shared types. — [pkgs/core/src/index.ts#L3-L51](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/index.ts#L3-L51) [pkgs/core/src/index.ts#L180-L248](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/index.ts#L180-L248)
- Published core root imports resolve to index.js/index.d.ts, while require resolves to index.cjs/index.d.cts. — [pkgs/core/package.json#L763-L775](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/package.json#L763-L775)
- TZDate extends TZDateMini's target-zone representation; UTCDate extends UTCDateMini's redirected UTC accessors. — [pkgs/tz/src/date/index.js#L1-L18](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/index.js#L1-L18) [pkgs/tz/src/date/mini.js#L3-L28](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L3-L28) [pkgs/utc/src/date/mini.js#L22-L29](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/src/date/mini.js#L22-L29) [pkgs/utc/src/date/index.js#L3-L16](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/src/date/index.js#L3-L16)
- The private dev package exposes date-fns-build-package and date-fns-test-tz; its builder preserves modules, externalizes imports, and rewrites relative import extensions. — [pkgs/dev/package.json#L1-L12](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/dev/package.json#L1-L12) [pkgs/dev/src/build/package.ts#L16-L32](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/dev/src/build/package.ts#L16-L32) [pkgs/dev/src/build/package.ts#L74-L89](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/dev/src/build/package.ts#L74-L89)
- The docs package exposes date-fns-docs and uses Firebase Admin with Typesaurus collections named packages, versions, and pages. — [pkgs/docs/package.json#L18-L19](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/package.json#L18-L19) [pkgs/docs/package.json#L41-L46](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/package.json#L41-L46) [pkgs/docs/src/db.ts#L1-L10](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/db.ts#L1-L10) [pkgs/docs/src/bin.ts#L21-L30](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L21-L30)
- Auxiliary applications are a React/Vite formatted-date example and a Hono playground serving browser JavaScript on port 3000. — [pkgs/core/examples/vite/src/main.tsx#L1-L10](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/examples/vite/src/main.tsx#L1-L10) [pkgs/core/examples/vite/src/App.tsx#L4-L12](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/examples/vite/src/App.tsx#L4-L12) [pkgs/core/examples/vite/vite.config.ts#L1-L7](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/examples/vite/vite.config.ts#L1-L7) [pkgs/tz/playground/src/server.ts#L5-L20](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/playground/src/server.ts#L5-L20)
- Temporal-oriented index.tp.ts implementations have a separate Vitest project and are excluded from production source-entry discovery and declaration output. — [pkgs/core/src/addMonths/index.tp.ts#L1-L18](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/index.tp.ts#L1-L18) [pkgs/core/vitest.config.ts#L28-L45](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/vitest.config.ts#L28-L45) [pkgs/dev/src/build/package.ts#L60-L70](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/dev/src/build/package.ts#L60-L70) [pkgs/core/tsconfig.dist.json#L19-L23](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/tsconfig.dist.json#L19-L23)

## Feature catalog

The primary user surface is a broad collection of date APIs, with individual imports and functional-programming variants. Formatting and parsing combine Unicode-style tokens with locale-specific behavior. Calendar operations and interval enumeration preserve date-extension context. Companion packages expose UTC and arbitrary-zone dates, while repository examples and documentation tooling support integration and publication.
- Calendar APIs include addition, subtraction, calendar differences, predicates, and start/end boundaries; addMonths clamps dates to the destination month's last day. — [pkgs/core/src/index.ts#L3-L41](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/index.ts#L3-L41) [pkgs/core/src/index.ts#L215-L241](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/index.ts#L215-L241) [pkgs/core/src/addMonths/index.ts#L69-L99](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/index.ts#L69-L99)
- format supports escaped literals, localized P/p expansion, locale preprocessing, and token dispatch; formatDate is an alias. — [pkgs/core/src/format/index.ts#L48-L49](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L48-L49) [pkgs/core/src/format/index.ts#L374-L415](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L374-L415) [pkgs/core/src/format/index.ts#L423-L441](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L423-L441)
- parse consumes text against a format and reference date, rejects incompatible token combinations, permits trailing whitespace, and validates setters before returning a date. — [pkgs/core/src/parse/index.ts#L361-L389](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L361-L389) [pkgs/core/src/parse/index.ts#L432-L468](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L432-L468) [pkgs/core/src/parse/index.ts#L494-L531](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L494-L531)
- eachDayOfInterval returns cloned midnight dates inclusively, supports reversed intervals and negative steps, and returns an empty array for a zero step. — [pkgs/core/src/eachDayOfInterval/index.ts#L73-L95](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/eachDayOfInterval/index.ts#L73-L95)
- formatDistance selects localized second-to-year phrases using elapsed time and offset correction; locale objects also supply relative formats, long formats, localization, and parsing matches. — [pkgs/core/src/formatDistance/index.ts#L123-L175](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/formatDistance/index.ts#L123-L175) [pkgs/core/src/formatDistance/index.ts#L183-L205](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/formatDistance/index.ts#L183-L205) [pkgs/core/src/locale/en-US/index.ts#L16-L26](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/locale/en-US/index.ts#L16-L26)
- The FP surface curries functions with reversed arguments; generated WithOptions variants retain the options argument, while @pure false functions are skipped. — [pkgs/core/src/fp/_lib/convertToFP/index.ts#L15-L24](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/fp/_lib/convertToFP/index.ts#L15-L24) [pkgs/core/scripts/build/fp.ts#L29-L48](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/fp.ts#L29-L48) [pkgs/core/scripts/build/fp.ts#L62-L65](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/fp.ts#L62-L65)
- Time-zone APIs provide tz/utc context factories, zone conversion preserving timestamps, UTC offsets, offset-change scanning, and four zone-name styles. — [pkgs/tz/src/tz/index.ts#L3-L13](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/tz/index.ts#L3-L13) [pkgs/utc/src/utc/index.ts#L3-L12](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/src/utc/index.ts#L3-L12) [pkgs/tz/src/date/index.js#L79-L86](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/index.js#L79-L86) [pkgs/tz/src/tzScan/index.ts#L14-L36](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/tzScan/index.ts#L14-L36) [pkgs/tz/src/tzName/index.ts#L4-L25](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/tzName/index.ts#L4-L25)
- Maintainer-facing features include documentation publication and --rollback; integration examples display yyyy-MM-dd in React and log UTC TZDate representations in the playground. — [pkgs/docs/src/bin.ts#L30-L67](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L30-L67) [pkgs/core/examples/vite/src/App.tsx#L4-L12](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/examples/vite/src/App.tsx#L4-L12) [pkgs/tz/playground/src/browser.ts#L1-L6](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/playground/src/browser.ts#L1-L6)

## Data flow

Date inputs enter through typed arguments and are normalized into fresh objects before calculation. Context functions and construction hooks determine the date class and time zone used by downstream accessors. Formatting produces strings, parsing builds dates through ordered setters, and enumeration produces arrays of cloned dates. Documentation processing is a separate flow from local files and reflection data into remote collections.
- DateArg accepts a Date subtype, number, or string; toDate forwards the input and optional context to constructFrom. — [pkgs/core/src/types.ts#L8-L20](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/types.ts#L8-L20) [pkgs/core/src/toDate/index.ts#L42-L50](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/toDate/index.ts#L42-L50)
- constructFrom prioritizes a supplied function, then constructFromSymbol, then a Date instance's constructor, and finally native Date construction. — [pkgs/core/src/constructFrom/index.ts#L44-L59](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/constructFrom/index.ts#L44-L59)
- normalizeDates binds a constructor context using the explicit context or first object argument, then maps every input through it; normalizeInterval applies this to both endpoints. — [pkgs/core/src/_lib/normalizeDates/index.ts#L19-L27](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/_lib/normalizeDates/index.ts#L19-L27) [pkgs/core/src/_lib/normalizeInterval/index.ts#L4-L9](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/_lib/normalizeInterval/index.ts#L4-L9)
- format resolves locale and week defaults, normalizes the date, expands long tokens into parts, optionally preprocesses them, and joins formatter results. — [pkgs/core/src/format/index.ts#L351-L380](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L351-L380) [pkgs/core/src/format/index.ts#L385-L415](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L385-L415) [pkgs/core/src/format/index.ts#L423-L441](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L423-L441)
- Parser.run converts a parsed value into a ValueSetter and remaining text; parse retains one setter per priority, validates it against the evolving date, and merges returned flags. — [pkgs/core/src/parse/_lib/Parser.ts#L10-L30](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/Parser.ts#L10-L30) [pkgs/core/src/parse/index.ts#L499-L528](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L499-L528)
- TZDateMini stores the instant on itself and wall-clock fields on internal; timestamp writes call syncToInternal, while local setters call syncFromInternal and adjustToSystemTZ. — [pkgs/tz/src/date/mini.js#L3-L26](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L3-L26) [pkgs/tz/src/date/mini.js#L100-L107](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L100-L107) [pkgs/tz/src/date/mini.js#L130-L147](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L130-L147) [pkgs/tz/src/date/mini.js#L185-L204](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L185-L204)
- Global default options live in a module variable; setDefaultOptions copies existing own properties, merges new values, deletes keys set to undefined, and replaces the state object. — [pkgs/core/src/_lib/defaultOptions/index.ts#L12-L20](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/_lib/defaultOptions/index.ts#L12-L20) [pkgs/core/src/setDefaultOptions/index.ts#L52-L76](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/setDefaultOptions/index.ts#L52-L76)
- Documentation inputs resolve relative to the imported config; TypeDoc references become serialized function pages and Markdown files become static pages before package metadata, version summaries, and page records are written. — [pkgs/docs/src/json.ts#L18-L24](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/json.ts#L18-L24) [pkgs/docs/src/bin.ts#L149-L193](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L149-L193) [pkgs/docs/src/bin.ts#L196-L212](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L196-L212) [pkgs/docs/src/bin.ts#L69-L120](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L69-L120)

## Behavior traces

The inspected flows cover an example startup, primary formatting and parsing actions, date arithmetic, subclass synchronization, and remote documentation persistence. Each trace follows concrete function calls and material branch conditions. Calculation flows end at returned values; the publisher ends at remote writes or deletions. These are source-derived execution traces, not observed runs.
- Example startup: main.tsx calls ReactDOM.createRoot(...).render → StrictMode → App → new Date → format(today, 'yyyy-MM-dd') → paragraph containing the returned string. — [pkgs/core/examples/vite/src/main.tsx#L1-L10](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/examples/vite/src/main.tsx#L1-L10) [pkgs/core/examples/vite/src/App.tsx#L4-L12](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/examples/vite/src/App.tsx#L4-L12)
- Formatting: format → getDefaultOptions → toDate → constructFrom → isValid → longFormatters → optional localize.preprocessor → protected-token check → formatters[token[0]] → join; invalid dates throw RangeError. — [pkgs/core/src/format/index.ts#L351-L380](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L351-L380) [pkgs/core/src/format/index.ts#L412-L441](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L412-L441) [pkgs/core/src/toDate/index.ts#L42-L50](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/toDate/index.ts#L42-L50) [pkgs/core/src/constructFrom/index.ts#L51-L59](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/constructFrom/index.ts#L51-L59)
- Parsing: parse expands tokens → looks up parsers → checks incompatibilities → Parser.run creates ValueSetter → rejects leftover non-whitespace → orders setters → validate/set; DateParser checks month/leap-year bounds before setting the day. — [pkgs/core/src/parse/index.ts#L403-L468](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L403-L468) [pkgs/core/src/parse/index.ts#L494-L531](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L494-L531) [pkgs/core/src/parse/_lib/Parser.ts#L10-L30](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/Parser.ts#L10-L30) [pkgs/core/src/parse/_lib/parsers/DateParser.ts#L32-L53](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/parsers/DateParser.ts#L32-L53)
- Zoned month addition: tz(zone) → TZDate.tz → addMonths → toDate with options.in → constructFrom(context, input) → destination-month-end calculation → clamp or setFullYear; NaN returns Invalid Date and zero returns the clone. — [pkgs/tz/src/tz/index.ts#L12-L13](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/tz/index.ts#L12-L13) [pkgs/tz/src/date/index.js#L7-L8](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/index.js#L7-L8) [pkgs/core/src/constructFrom/index.ts#L51-L59](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/constructFrom/index.ts#L51-L59) [pkgs/core/src/addMonths/index.ts#L63-L99](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/index.ts#L63-L99)
- Target-zone setter: generated setHours writes internal.setUTCHours → syncFromInternal copies fields through native local setters → adjustToSystemTZ handles offset/DST differences → syncToInternal rebuilds the final wall-clock representation. — [pkgs/tz/src/date/mini.js#L135-L140](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L135-L140) [pkgs/tz/src/date/mini.js#L185-L204](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L185-L204) [pkgs/tz/src/date/mini.js#L425-L454](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L425-L454) [pkgs/tz/src/date/mini.js#L491-L504](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L491-L504)
- UTC context: utc(value) converts the input to a timestamp → new UTCDate → UTCDateMini constructor sets time; local getter/setter names resolve to UTC methods and getTimezoneOffset returns zero. — [pkgs/utc/src/utc/index.ts#L11-L12](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/src/utc/index.ts#L11-L12) [pkgs/utc/src/date/index.js#L16-L16](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/src/date/index.js#L16-L16) [pkgs/utc/src/date/mini.js#L1-L29](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/src/date/mini.js#L1-L29)
- Documentation publication: initializeApp → resolve/import config → getVersion validates package version → getFnPages/getMarkdownPages → concurrently update package versions, add a version summary, and commit a page batch → exit 0; errors exit 1. — [pkgs/docs/src/bin.ts#L21-L32](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L21-L32) [pkgs/docs/src/bin.ts#L63-L120](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L63-L120) [pkgs/docs/src/bin.ts#L123-L146](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L123-L146)
- Documentation rollback: after config/version loading, --rollback concurrently filters the package's version list, queries and removes matching version documents, and queries and removes matching page documents. — [pkgs/docs/src/bin.ts#L30-L61](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L30-L61)

## Testing signals

Tests and CI were inspected, not executed; no passing status or coverage percentage is established. Vitest discovers package projects, with separate core main and Temporal-oriented suites and package-specific isolation settings. Inspected tests exercise mutation guarantees, invalid input, parsing boundaries, context types, DST gaps, and historical offsets. CI describes browser, Node-version, time-zone, smoke, type, lint, and locale checks, but this bounded inspection does not establish exhaustive coverage.
- Root Vitest discovers pkgs/*; core main includes src/**/test.ts, temporarily includes test.tp.ts, and both use forks, disabled isolation, concurrent sequencing, and optional Chromium via Playwright. — [vitest.config.ts#L1-L7](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/vitest.config.ts#L1-L7) [pkgs/core/vitest.config.ts#L7-L45](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/vitest.config.ts#L7-L45)
- addMonths tests assert timestamp support, input immutability, month-end clamping, pre-100 AD dates, invalid dates/amounts, UTCDate retention, and TZDate context inference. — [pkgs/core/src/addMonths/test.ts#L9-L49](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/test.ts#L9-L49) [pkgs/core/src/addMonths/test.ts#L151-L180](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/test.ts#L151-L180)
- Formatting tests cover quote escaping and formatDate alias behavior; parsing tests cover leap-day bounds, mismatches, invalid references, trailing whitespace, and unescaped-letter errors. — [pkgs/core/src/format/test.ts#L45-L69](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/test.ts#L45-L69) [pkgs/core/src/parse/test.ts#L2050-L2063](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/test.ts#L2050-L2063) [pkgs/core/src/parse/test.ts#L2230-L2273](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/test.ts#L2230-L2273)
- TZ tests include src/**/tests.ts and test/**/*.test.ts; inspected edge cases assert spring-forward normalization and historical second-offset behavior, while UTC configuration enables isolation. — [pkgs/tz/vitest.config.ts#L3-L10](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/vitest.config.ts#L3-L10) [pkgs/tz/test/edge/new-york.test.ts#L13-L36](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/test/edge/new-york.test.ts#L13-L36) [pkgs/tz/test/edge/historical.test.ts#L4-L26](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/test/edge/historical.test.ts#L4-L26) [pkgs/utc/vitest.config.ts#L3-L10](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/vitest.config.ts#L3-L10)
- Push/PR workflows invoke core Node, browser, and time-zone tasks; Node tests name versions 22/24/25/26, and the zone runner launches Vitest with TZ and VITEST_MAX_WORKERS=1. — [.github/workflows/node_tests.yaml#L3-L15](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/.github/workflows/node_tests.yaml#L3-L15) [.github/workflows/browser_tests.yaml#L18-L22](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/.github/workflows/browser_tests.yaml#L18-L22) [pkgs/core/scripts/test/node.sh#L7-L21](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/test/node.sh#L7-L21) [pkgs/dev/src/test/tz.ts#L407-L413](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/dev/src/test/tz.ts#L407-L413)
- Smoke CI delegates to example tasks; quality CI invokes type checking, linting, and locale snapshots, whose renderer covers format/parse, distances, relative dates, and durations under TZ=utc. — [.github/workflows/smoke_tests.yaml#L14-L15](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/.github/workflows/smoke_tests.yaml#L14-L15) [.github/workflows/code_quality.yaml#L14-L21](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/.github/workflows/code_quality.yaml#L14-L21) [pkgs/core/mise.toml#L115-L123](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/mise.toml#L115-L123) [pkgs/core/scripts/build/localeSnapshots/index.ts#L24-L50](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/localeSnapshots/index.ts#L24-L50)
- The inspected docs tests assert export/module-node classification and repository-path conversion; its npm test script is a deliberate failure placeholder despite a Vitest tests.ts configuration, so that script is not a reliable docs-suite entrypoint. — [pkgs/docs/src/data/tests.ts#L1-L29](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/data/tests.ts#L1-L29) [pkgs/docs/vitest.config.ts#L3-L8](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/vitest.config.ts#L3-L8) [pkgs/docs/package.json#L38-L40](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/package.json#L38-L40)
- Coverage CI is workflow_dispatch-only with a TODO; addMonths DST cases are conditional on detected transitions, and inspected docs helper tests do not demonstrate Firebase publication/rollback verification. Tests and workflows were read, not run. — [.github/workflows/coverage.yaml#L3-L18](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/.github/workflows/coverage.yaml#L3-L18) [pkgs/core/src/addMonths/test.ts#L52-L55](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/test.ts#L52-L55) [pkgs/docs/src/data/tests.ts#L1-L29](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/data/tests.ts#L1-L29) [pkgs/docs/src/bin.ts#L34-L120](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L34-L120)

## Risk map

The strongest source observations concern documentation side effects, snapshot mode selection, date-state synchronization, and build-output paths. These observations are not confirmed security vulnerabilities, and no exploit or runtime failure was reproduced. Library correctness depends on preserving constructor context and handling native Date and Intl edge cases. Potential operational consequences are explicitly labeled as hypotheses where execution would be needed.
- Source-observed snapshot mismatch: test/locales passes --test, but the script compares only when process.argv[2] equals 'test'; the supplied --test therefore selects the writeFile branch. — [pkgs/core/mise.toml#L111-L113](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/mise.toml#L111-L113) [pkgs/core/scripts/build/localeSnapshots/index.ts#L22-L25](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/localeSnapshots/index.ts#L22-L25) [pkgs/core/scripts/build/localeSnapshots/index.ts#L60-L68](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/localeSnapshots/index.ts#L60-L68)
- The docs CLI dynamically imports a process-argument path and initializes Firebase Admin before dispatch; package, TypeDoc, and Markdown paths are resolved from config without a repository-root containment check in these inspected paths. — [pkgs/docs/src/bin.ts#L21-L30](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L21-L30) [pkgs/docs/src/bin.ts#L135-L137](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L135-L137) [pkgs/docs/src/bin.ts#L200-L204](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L200-L204) [pkgs/docs/src/json.ts#L18-L24](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/json.ts#L18-L24)
- Hypothesis: documentation publication or rollback can leave partial remote state after an individual failure because package, version, and page operations run concurrently without one encompassing transaction. (inferred) — [pkgs/docs/src/bin.ts#L34-L61](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L34-L61) [pkgs/docs/src/bin.ts#L73-L120](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L73-L120) [pkgs/docs/src/bin.ts#L127-L129](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L127-L129)
- TZDateMini is a correctness hotspot: separate instant/wall-clock objects require synchronization, historical second corrections, DST-gap detection, and a final small-drift correction bounded below 30 minutes. — [pkgs/tz/src/date/mini.js#L3-L26](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L3-L26) [pkgs/tz/src/date/mini.js#L363-L385](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L363-L385) [pkgs/tz/src/date/mini.js#L425-L440](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L425-L440) [pkgs/tz/src/date/mini.js#L491-L504](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/mini.js#L491-L504)
- tzOffset caches formatter functions by zone and offsets by strings, catches Intl failures, and falls back to an unanchored numeric-offset regex; cache bounds and stricter fallback input validation are not present in this inspected implementation. — [pkgs/tz/src/tzOffset/index.ts#L1-L3](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/tzOffset/index.ts#L1-L3) [pkgs/tz/src/tzOffset/index.ts#L22-L60](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/tzOffset/index.ts#L22-L60)
- Module-global defaults affect format and parse, while multi-date normalization uses the first object unless a context is supplied; the time-zone guide explicitly demonstrates order-dependent business-day results. — [pkgs/core/src/_lib/defaultOptions/index.ts#L12-L20](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/_lib/defaultOptions/index.ts#L12-L20) [pkgs/core/src/format/index.ts#L351-L366](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L351-L366) [pkgs/core/src/_lib/normalizeDates/index.ts#L23-L27](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/_lib/normalizeDates/index.ts#L23-L27) [pkgs/core/docs/timeZones.md#L40-L55](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/docs/timeZones.md#L40-L55)
- Build tooling performs filesystem mutations and shell-outs: package.sh removes package-local dist, the dev builder accepts source/output paths and runs oxfmt, and CDN construction recursively removes an environment-selected output when building a separate CDN package. — [pkgs/core/scripts/build/package.sh#L54-L67](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/package.sh#L54-L67) [pkgs/dev/src/build/package.ts#L8-L32](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/dev/src/build/package.ts#L8-L32) [pkgs/core/scripts/build/cdn.ts#L12-L26](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/cdn.ts#L12-L26) [pkgs/core/scripts/build/cdn.ts#L41-L42](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/cdn.ts#L41-L42)
- Source-observed subpath mismatch: tz workspace exports reference several paths without src and Date .ts files, while inspected implementations reside under src with Date .js files; utc Date subpaths likewise target .ts instead of the inspected .js implementations. Resolution impact was not tested. — [pkgs/tz/package.json#L25-L33](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/package.json#L25-L33) [pkgs/tz/src/date/index.js#L1-L4](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/index.js#L1-L4) [pkgs/tz/src/tzOffset/index.ts#L22-L29](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/tzOffset/index.ts#L22-L29) [pkgs/utc/package.json#L22-L26](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/package.json#L22-L26) [pkgs/utc/src/date/mini.js#L1-L14](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/utc/src/date/mini.js#L1-L14)

## Extension points

Extensions plug into typed date construction, locale objects, token tables, and code-generation inputs. Public function discovery drives export maps and indices rather than requiring every output to be hand-maintained. Parser classes expose explicit compatibility and priority contracts. Documentation has its own configuration interface for additional static pages, categories, and reflection overrides.
- Custom Date subclasses can implement ConstructableDate's constructFromSymbol hook; constructFrom also accepts a context factory directly, and TZDate implements the shared constructDateFrom symbol. — [pkgs/core/src/types.ts#L13-L20](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/types.ts#L13-L20) [pkgs/core/src/constructFrom/index.ts#L51-L59](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/constructFrom/index.ts#L51-L59) [pkgs/tz/src/date/index.js#L83-L86](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/tz/src/date/index.js#L83-L86)
- New public functions enter generator discovery through listFns; indices.ts generates the root index, FP index, locale index, TypeDoc configuration, and workspace/published export maps. — [pkgs/core/scripts/build/indices.ts#L21-L38](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/indices.ts#L21-L38) [pkgs/core/scripts/build/indices.ts#L52-L84](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/indices.ts#L52-L84)
- Parsing tokens plug into the parsers table through Parser subclasses that declare incompatibleTokens, priority, optional subPriority, parse, validate, and set behavior. — [pkgs/core/src/parse/_lib/parsers/index.ts#L77-L109](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/parsers/index.ts#L77-L109) [pkgs/core/src/parse/_lib/Parser.ts#L5-L30](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/Parser.ts#L5-L30) [pkgs/core/src/parse/_lib/Parser.ts#L33-L53](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/Parser.ts#L33-L53)
- Formatter behavior plugs into the formatters table keyed by token letter; handlers receive date, full token, localize functions, and week/locale options, and format reexports formatter tables for downstream libraries. — [pkgs/core/src/_lib/format/formatters/index.ts#L30-L37](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/_lib/format/formatters/index.ts#L30-L37) [pkgs/core/src/_lib/format/formatters/index.ts#L85-L115](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/_lib/format/formatters/index.ts#L85-L115) [pkgs/core/src/format/index.ts#L22-L24](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L22-L24)
- A locale supplies formatDistance, formatLong, formatRelative, localize, match, and week options; the contribution guide recommends copying an existing locale and replacing its data using CLDR as a reference. — [pkgs/core/src/locale/en-US/index.ts#L16-L26](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/locale/en-US/index.ts#L16-L26) [pkgs/core/docs/i18nContributionGuide.md#L44-L63](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/docs/i18nContributionGuide.md#L44-L63)
- Locale-specific token rewriting can use localize.preprocessor, which receives the normalized date and classified FormatPart array before final formatting. — [pkgs/core/src/format/index.ts#L374-L415](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/format/index.ts#L374-L415)
- FP generation derives arity and options variants from reflection signatures and excludes @pure false functions; generated wrappers delegate to the shared convertToFP implementation. — [pkgs/core/scripts/build/fp.ts#L29-L48](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/fp.ts#L29-L48) [pkgs/core/scripts/build/fp.ts#L62-L65](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/fp.ts#L62-L65) [pkgs/core/scripts/build/fp.ts#L81-L87](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/fp.ts#L81-L87) [pkgs/core/src/fp/_lib/convertToFP/index.ts#L15-L24](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/fp/_lib/convertToFP/index.ts#L15-L24)
- DateFnsDocs.Config extends publication inputs through package/json paths, ordered categories, static files, and kindsMap overrides; readRefsFromJSON uses overrides to classify constants and assign categories. — [pkgs/docs/src/types.ts#L8-L33](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/types.ts#L8-L33) [pkgs/docs/src/json.ts#L63-L81](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/json.ts#L63-L81)

## Contributor handoff

Tests and CI were inspected, not executed, and this brief is bounded to the source files read. Begin changes at the owning function or package, then follow construction, locale, and generated-output dependencies. Existing manifests and mise tasks provide more current command evidence than several older contributing examples. Preserve the read-only authority of this investigation; the checks below are future validation guidance when execution is authorized.
- Read AGENTS.md and the owning package's implementation/test/config first; repository instructions identify core, UTC, and TZ boundaries and prohibit unsolicited commits or pushes. — [AGENTS.md#L1-L7](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/AGENTS.md#L1-L7) [AGENTS.md#L23-L27](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/AGENTS.md#L23-L27) [pkgs/core/src/addMonths/test.ts#L1-L6](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/test.ts#L1-L6)
- Preserve the construction contract during date edits: use the existing toDate/constructFrom path so context factories, symbol hooks, subclass constructors, and cloned inputs remain intact. — [pkgs/core/src/toDate/index.ts#L42-L50](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/toDate/index.ts#L42-L50) [pkgs/core/src/constructFrom/index.ts#L44-L59](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/constructFrom/index.ts#L44-L59) [pkgs/core/src/addMonths/test.ts#L19-L22](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/test.ts#L19-L22) [pkgs/core/src/addMonths/test.ts#L157-L180](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/addMonths/test.ts#L157-L180)
- For parser changes, read Parser, Setter, the registry, and the specific parser together; compatibility rejection, priority selection, Invalid Date returns, and RangeError branches are distinct contracts. — [pkgs/core/src/parse/_lib/Parser.ts#L5-L30](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/Parser.ts#L5-L30) [pkgs/core/src/parse/_lib/Setter.ts#L86-L101](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/_lib/Setter.ts#L86-L101) [pkgs/core/src/parse/index.ts#L432-L496](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L432-L496) [pkgs/core/src/parse/index.ts#L499-L531](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/src/parse/index.ts#L499-L531)
- Edit generator logic rather than treating generated indices/FP wrappers as independent source; indices.ts rewrites package.json and export indices, and fp.ts labels emitted wrappers as generated. — [pkgs/core/scripts/build/indices.ts#L26-L38](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/indices.ts#L26-L38) [pkgs/core/scripts/build/fp.ts#L81-L87](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/fp.ts#L81-L87)
- Locale work requires the contribution guide and snapshot review; distinguish generation from comparison and address the --test versus test mode mismatch before trusting the existing locale-check task. — [AGENTS.md#L9-L13](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/AGENTS.md#L9-L13) [pkgs/core/docs/i18nContributionGuide.md#L44-L63](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/docs/i18nContributionGuide.md#L44-L63) [pkgs/core/mise.toml#L111-L123](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/mise.toml#L111-L123) [pkgs/core/scripts/build/localeSnapshots/index.ts#L60-L68](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/localeSnapshots/index.ts#L60-L68)
- When execution is authorized, start with the relevant Vitest file, then applicable mise type/lint, browser, time-zone, or smoke tasks; this investigation inspected those tests and CI definitions without running them. — [pkgs/core/mise.toml#L84-L119](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/mise.toml#L84-L119) [mise.toml#L19-L29](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/mise.toml#L19-L29) [.github/workflows/code_quality.yaml#L14-L21](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/.github/workflows/code_quality.yaml#L14-L21) [pkgs/core/vitest.config.ts#L12-L24](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/vitest.config.ts#L12-L24)
- Check documentation commands against current tooling: CONTRIBUTING.md still describes lib output and Prettier/ESLint, while package.sh emits dist/date-fns and root mise uses oxfmt/oxlint. — [CONTRIBUTING.md#L108-L135](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/CONTRIBUTING.md#L108-L135) [pkgs/core/scripts/build/package.sh#L58-L60](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/package.sh#L58-L60) [mise.toml#L25-L29](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/mise.toml#L25-L29)
- Keep verification commands separate from publishing and build mutations: docs CLI writes/deletes remote records, package.sh deletes dist, and Temporal implementations are excluded from production builds despite having their own test project. — [pkgs/docs/src/bin.ts#L34-L61](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L34-L61) [pkgs/docs/src/bin.ts#L73-L120](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/docs/src/bin.ts#L73-L120) [pkgs/core/scripts/build/package.sh#L62-L63](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/scripts/build/package.sh#L62-L63) [pkgs/core/tsconfig.dist.json#L19-L23](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/tsconfig.dist.json#L19-L23) [pkgs/core/vitest.config.ts#L28-L38](https://github.com/date-fns/date-fns/blob/717ce0a807ea4c6b540d015b5c408723175b2838/pkgs/core/vitest.config.ts#L28-L38)

Source repository: https://github.com/date-fns/date-fns
Full evidence corpus: https://github.com/Codevetter/codevetter/tree/main/benchmarks/repo-unpacks/date-fns.json

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
