Luxon

Immutable, chainable date and time handling for JavaScript with built-in time zones and Intl.

Library
npm
v3.7.2
16,461 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
61 /100 Good
Development Activity 52
Maintenance 28
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
87 /100 Excellent
Architecture 86
Code Quality 88
Innovation 90
Learning Curve 80

Luxon is a modern JavaScript library for working with dates, times, durations, and intervals. Built by a Moment.js maintainer, it offers an immutable, chainable API and relies on the platform’s native Intl support for time zones and localization, so there are no locale or time-zone data files to bundle.

It models the domain with distinct DateTime, Duration, Interval, and Info types, handles invalid values gracefully through a sentinel pattern rather than exceptions, and covers parsing and formatting for ISO, RFC 2822, HTTP, SQL, and custom token formats.

What You Get

  • Immutable DateTime, Duration, and Interval types with a fluent, chainable API
  • Native IANA time-zone support via the Intl API, with no bundled tz data
  • Parsing and formatting for ISO 8601, RFC 2822, HTTP, SQL, and custom token formats
  • Locale-aware formatting and human-readable relative time using Intl
  • A graceful invalid-value model that avoids throwing on bad input

Common Use Cases

  • Parsing and reformatting API timestamps across time zones
  • Displaying localized, human-friendly dates and relative times in UIs
  • Computing durations, differences, and calendar math between events
  • Scheduling logic that must respect a specific IANA time zone
  • Migrating away from the legacy, mutable Moment.js API

Under The Hood

Architecture Luxon centers on four public types exported from src/luxon.js: DateTime (src/datetime.js), Duration (src/duration.js), Interval (src/interval.js), and the Info metadata facade (src/info.js). A Zone abstraction (src/zone.js) has concrete implementations for fixed offsets, IANA zones, the system zone, and an invalid zone under src/zones/. The heavy lifting lives in src/impl/, which separates concerns into a formatter, regexParser and tokenParser, calendar conversions (gregorian/week/ordinal), diff, locale, and shared util helpers, keeping the public types thin over well-isolated internals.

Tech Stack The library is written in plain ES-module JavaScript with no runtime dependencies, leaning entirely on the platform Intl object for time-zone resolution and localization. It is transpiled with Babel and bundled with Rollup into ES6 (build/es6/luxon.mjs) and CommonJS (build/node/luxon.js) outputs via the tasks in tasks/. Testing uses Jest with coverage, and formatting is enforced with Prettier through lint-staged and Husky hooks.

Code Quality The repository carries a substantial test suite of roughly 60 spec files under test/, mirroring the source layout (datetime, duration, interval, zones, impl). Error handling is deliberate: rather than throwing on bad input, operations produce ‘invalid’ sentinel values, with a small hierarchy of LuxonError subclasses in src/errors.js reserved for genuine misuse. Naming is consistent and the immutable design keeps functions pure and easy to reason about.

API Design The public API is a strong point: it is immutable and chainable, so expressions like DateTime.now().setZone('America/New_York').minus({ weeks: 1 }).endOf('day').toISO() read naturally. Method names are consistent and unambiguous, getting started requires almost no boilerplate, and the project ships extensive guides and generated API docs. TypeScript users consume separately published @types/luxon definitions rather than bundled types.

Used by 33 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
Go
55%
Apache 2.0

Authgear

Authentication

2,074

Open-source, self-hostable authentication platform with passkeys, biometric login, SSO, MFA, and GraphQL admin API — a full Auth0/Clerk/Firebase alternative for SaaS and mobile apps.

View details
88
Repo Health
81
Technical
68
Dependency
Built with
Go 55%
HTML 24%
TypeScript 18%
Updated 1 weeks ago
JavaScript
100%
Other

Automatisch

Automation · No Code Platforms

13,979

Self-hosted, no-code workflow automation that keeps your data on your own servers—a privacy-first alternative to Zapier with 90+ integrations.

View details
49
Repo Health
78
Technical
62
Dependency
Built with
JavaScript 100%
Updated 7 months ago
TypeScript
96%
Other

Cal.diy

Scheduling

48,697

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
91
Repo Health
86
Technical
65
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
JavaScript
99%
Other

ChartBrew

Analytics · Databases

4,063

Open-source reporting platform to build live dashboards from SQL, NoSQL, APIs, and SaaS tools with an AI assistant that creates charts from natural language.

View details
90
Repo Health
83
Technical
64
Dependency
Built with
JavaScript 99%
Updated 1 weeks ago
Python
47%
MIT

Docs

CMS · File Storage

16,868

Open-source collaborative knowledge platform with real-time editing, AI writing tools, and full self-hosting control — built by the French and German governments.

View details
88
Repo Health
81
Technical
68
Dependency
Built with
Python 47%
TypeScript 45%
Updated 5 days ago
TypeScript
92%
AGPL 3.0

Documenso

Digital Signiture

15,224

Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.

View details
93
Repo Health
79
Technical
68
Dependency
Built with
TypeScript 92%
Updated 5 days ago
JavaScript
99%
AGPL 3.0

drawDB

Databases

39,723

Design database schemas visually in your browser and export executable SQL for any major database — no account required.

View details
77
Repo Health
70
Technical
73
Dependency
Built with
JavaScript 99%
Updated 1 weeks ago
TypeScript
100%
Other

Dub

Analytics · Marketing

24,835

The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.

View details
81
Repo Health
78
Technical
62
Dependency
Built with
TypeScript 100%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers