CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

date-fns/date-fns

Scanned commit 717ce0a807 dated 2026-09-22 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/date-fns/date-fns ↗ · 2020 files · 10.3 MB

🔥️ NEW: date-fns v4.0 with first-class time zone support is out!

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (416s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

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.

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.

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.

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.

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.

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.

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.

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.

Languages

LanguageFilesShare of source
TypeScript172195%
Markdown126docs/config
JSON54docs/config
JavaScript473%
TOML261%
Shell141%
YAML11docs/config
CSS2docs/config

Start reading here

Probable source entrypoint: pkgs/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

pkgs/ (1990 files) codemods/ (1 files)

Source layout — pkgs/

PathFiles
pkgs/core/260

Repository structure

Top-level pathFiles
pkgs/1990
.github/8
.devcontainer/5
.agents/1
codemods/1
.opencode/1

Docs found: AGENTS.mdCONTRIBUTING.mdREADME.md

Package

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

oxfmtoxlintoxlint-tsgolinttypescriptvitest

CI & config entrypoints

Structural health signals

Average score 7.7/10 across 96 analyzed source files; 5 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history