# Extension points — date-fns/date-fns

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

# Extension points — date-fns/date-fns

Scanned commit 717ce0a807ea4c6b540d015b5c408723175b2838 (2026-09-22). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

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)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

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