fecha is a lightweight JavaScript library for date formatting and parsing, intended to replace moment.js style formatting and parsing. It provides `format` and `parse` functions with format tokens, plus optional i18n settings and named masks for common date patterns.
Project status
- Maintenance status: The repository’s most recent upstream push shown is 2023-01-05, but the latest published updates in the provided history are 4.2.1 (2021-04-05), suggesting the project is quiet/dormant rather than actively maintained as of 2026-08-12.
- Update cadence: Based on the provided update timeline, changes occur infrequently (for example, 2021 → 2020 → 2020, then several major changes earlier), and there is a multi year gap (about 5+ years since the last recorded update).
AI summary generated
Recent updates
4.2.1
Release 4.2.1 focuses on publishing sourcemaps to npm and includes a security-related dependency update (y18n). The provided release notes are effectively missing, so the actual code and packaging differences need to be inferred from the diff.
Security4.2.0
No release notes were provided for version 4.2.0 in the supplied release_notes block. The code diff shows the library gained new predefined masks (isoDate, isoDateTime) and added/extended timezone token support (notably a new Z token).
4.1.0
Version 4.1.0 adds support for a `Z` token for timezone offsets (with colon) and updates parsing to recognize `Z` in addition to `ZZ`. It also includes a fix targeted at a historical Peru timezone handling issue.
Features4.0.0
Version 4.0.0 primarily delivers a major API and packaging change, shifting fecha to TypeScript sources with named exports and ES module oriented distribution. The provided release notes are effectively empty (they only say there are no changes from alpha and beta), but the code diff shows significant public API, typing, and behavior changes.
Features4.0.0-alpha.1
This pre-release refactors `fecha` into an ES module-friendly implementation with named exports (`format`, `parse`, and global i18n/mask setter functions). It also changes date parsing behavior so invalid date strings result in `null` rather than producing a `Date`.
BreakingFeatures3.0.3
This release (3.0.3) updates literal handling in both fecha.format and fecha.parse to better support literal segments in the format string, specifically fixing bracket-style literals during parsing. The code change also alters the internal placeholder mechanism used while processing literal tokens.
3.0.2
Version 3.0.2 introduces a major packaging and build refactor, shifting the published entrypoints to a new UMD build in lib, an ES module entry in src, and a new minified build under dist. It also changes the parsing failure behavior and TypeScript export surface (default export only, and invalid parse results now use null).
2.3.3
Version 2.3.3 fixes formatting of years like 999 so the YYYY token includes a leading zero (0999 instead of 999). The patch also updates TypeScript definitions and extends strict timezone parsing to recognize the trailing 'Z' form.
Breaking2.3.1
Version 2.3.1 adds TypeScript type definitions and introduces a new strict date parser/formatter implementation (fecha.strict.js), along with associated tests and build/test script updates. It also updates parsing for the timezone token ZZ to accept the literal 'Z' (UTC). Release notes were not provided by the publisher, so the documented vs actual changes are not clear.
BreakingFeatures2.3.0
Version 2.3.0 adds support for literal text inside format masks using bracket syntax, documented briefly in the release notes. The README and test suite were updated to demonstrate bracketed literals in formatted output.
Features