moment/luxon
52.0
Adequate · 1 October 2026
8.1k
lines of production code
JavaScript
primary language
2
measurements over time
What this system is
This system is the Luxon JavaScript library, a modern date and time utility that provides core abstractions for DateTime, Duration, Interval, and Info operations. It handles parsing, formatting, and arithmetic across various time zones and locales, utilizing native ES modules for efficient bundling. The project includes a comprehensive test suite and performance benchmarks to ensure correctness, alongside tooling for documentation and interactive demos.
How it got here
2015–2017 — ESM migration and API consolidation
15 changes.
This period focused on modernizing the Luxon codebase by migrating to ES modules, replacing the legacy Instant class with DateTime as the primary abstraction, and restructuring internal implementation modules for better maintainability. The work included overhauling the build system to use Gulp and Rollup, expanding comprehensive test coverage for core classes, and enhancing the documentation site with interactive demos and dark mode support.
2018–2025 — Build migration and testing expansion
6 changes.
The project migrated its build system from Gulp to Rollup to support multiple module formats and introduced pre-commit linting hooks. Significant effort was dedicated to expanding test coverage for core DateTime, locale, and zone implementations, alongside adding performance benchmarks. Documentation site enhancements included the implementation of a dark mode toggle.
Features
Add dark mode toggle to the sidebar
A new dark theme toggle control is now available in the sidebar's app name area on all pages. This feature, implemented via a new Docsify plugin (dark-theme-toggle.js) and its associated styles (dark-theme-toggle.css), allows users to switch between light and dark modes. The toggle respects the user's system preference by default and persists their choice in local storage, providing a consistent way to adjust the site's appearance across all documentation pages.
site/plugins · high confidence
Add interactive demo pages for Luxon
New demo files (demo.js, demo.css, global.html, requirejs.html) have been added to the site/demo directory. These provide interactive examples of Luxon's DateTime, Duration, and Info APIs, allowing users to view code snippets and their outputs directly in the browser via global script or RequireJS loading.
site/demo · high confidence
Docker-based development and testing environment
A new Docker setup has been introduced to standardize the development and testing environment. The Dockerfile uses Node 15 slim and configures environment variables for locale, timezone, and CI settings. Helper scripts are provided to build the image, run npm commands within the container, and push the image, simplifying the process for contributors to run tests and commands in a consistent environment.
docker · high confidence
Documentation site now supports dark mode and inline code execution
The documentation site has been updated to include a dark theme, accessible via a toggle, and allows users to try Luxon directly in the browser by exposing the luxon global on the homepage.
site · high confidence
New development and release automation scripts
This change introduces a suite of shell scripts to streamline the development workflow and release process. The \test\ and \jest\ scripts standardize the test environment by enforcing specific time zones (America/New\_York) and locale settings (en\_US.utf8) to ensure consistent test execution. A new \repl\ script provides an interactive Node.js environment pre-loaded with Luxon's core classes (DateTime, Duration, Interval, etc.) for easier debugging. Administrative tasks are now handled by dedicated scripts: \release\ automates the build, site generation, npm publish, tagging, and site deployment; \tag\ creates and pushes git tags based on the package version; \version\ validates that version numbers are synchronized across package.json, package-lock.json, and source files before tagging; and \deploy-site\ manages the deployment of generated documentation to the gh-pages branch.
scripts · high confidence
Project initialization and repository structure setup
This change establishes the foundational structure of the repository, introducing the Luxon date/time library (version 3.7.2) with its core documentation (README, CHANGELOG, CONTRIBUTING, LICENSE) and configuration files. It sets up the build and test environment by adding Babel and Jest configurations, Prettier formatting rules, and editor settings (.editorconfig, .prettierrc), while replacing the previous Grunt-based build system with a modern npm script workflow. The commit also configures repository metadata via .gitignore, .gitattributes, and .agignore to manage vendored assets and version control behavior.
(repo-wide) · high confidence
Architecture
Refactored internal implementation modules for parsing, formatting, and locale handling
The internal implementation layer (src/impl) has been restructured into distinct modules to improve code organization and maintainability. This change introduces dedicated files for specific concerns: conversions (gregorian, ordinal, and week calculations), diffing logic, digit parsing with caching, English locale defaults, format presets, invalid state handling, locale configuration with Intl caching, regex-based parsing, token-based parsing, utility functions, zone normalization, and the main formatter. The formatter module has been significantly expanded to support macro tokens, system locale defaults, and more robust date-time formatting using Intl APIs. This refactoring lays the groundwork for better performance, easier testing, and clearer separation of concerns in the library's core logic.
src/impl · high confidence
Behavioural changes
Added pre-commit hook for linting
The project now includes a pre-commit hook that automatically runs lint-staged on staged files before each commit. This ensures code quality standards are enforced consistently by checking and formatting changes before they are committed to the repository.
.husky · high confidence
Build system migrated from Gulp to Rollup
The project's build process has been replaced with a new setup using Rollup, Babel, and UglifyJS, removing the previous Gulp-based tooling. This change introduces a new build pipeline that generates library bundles for various environments (Node, AMD, CJS, ES6, and global IIFE) and handles minification via an external UglifyJS step to ensure output correctness.
tasks · high confidence
Luxon 3.7.2 release with core library rewrite
This release updates the library to version 3.7.2 and introduces a significant architectural shift by replacing the legacy Instant class with the new DateTime class as the primary date-time abstraction. The core modules (DateTime, Duration, Interval, Info, and Settings) have been rewritten to use ES modules and modern JavaScript patterns, while the old Instant implementation and its global exports have been removed. This change simplifies the API surface and improves consistency across the library's date-time handling capabilities.
src · high confidence
Refactored zone system with dedicated IANA, fixed-offset, system, and invalid zone classes
The zone handling logic in src/zones has been restructured into four distinct classes: IANAZone (with memoization and Intl.DateTimeFormat caching for performance), FixedOffsetZone (handling UTC and named offsets like UTC+6), SystemZone (wrapping the environment's local time zone), and InvalidZone (for unparseable inputs). This change introduces specific behaviors such as returning canonical IANA names via normalizeZone, ensuring fixed-offset zones are marked as universal, and providing a dedicated invalid state that prevents errors when constructing zones from bad input.
src/zones · high confidence
Test coverage
Added comprehensive test coverage for the Interval class; Added comprehensive test suite for Duration behavior; Added performance benchmarks for DateTime and Info APIs; Added test coverage for Info API features, listers, locale weeks, and zones; Added test helper utilities and custom Jest matchers; Added unit tests for English locale formatting; Added unit tests for zone implementations; Expanded test coverage for DateTime creation, formatting, and locale-aware week calculations; Removed Instant test suite.
Dependencies
Luxon 3.7.2 release with ESM support and build overhaul
The package has been updated to version 3.7.2, introducing native ES module support via new \exports\ conditions (import/require) and dedicated ESM entry points (\build/es6/luxon.mjs\). The build system was migrated from Grunt to Gulp and Rollup, replacing legacy dependencies like \grunt\ and \gobble\ with modern tooling including \@babel/core\, \rollup\, and \jest\. The minimum Node.js engine requirement is now set to version 12 or higher, and the package is marked as side-effects-free to optimize bundler tree-shaking.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 51 → 52 (+0.7)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 42 → 42 (+0.0)
- Architecture 86 → 88 (+2.1)
- Maturity 56 → 56 (+0.3)
- Readiness 56 → 56 (+0.7)
- Security 69 → 75 (+6.3)
- Performance 71 (new)
Resolved (9)
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
- Documentation: contradicts the code (docs/validity.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no installation or build instructions (docs/install.md)
- Documentation: no usage examples (README.md)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- Hotspot: src/duration.js (src/duration.js)
- Off-boarding risk: anonymized user #1
New (7)
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (the committed lockfile resolved no direct production dependency)
- Documentation: hard to navigate (docs/tour.md)
- Documentation: no architecture or design documentation (docs/tour.md)
- Documentation: no architecture or design documentation (docs/upgrading.md)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- Off-boarding risk: anonymized user #1
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
moment/luxon was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f427515a38f6a671f8de663e6bcc040ed81f114e — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.