# tonysamperi/ts-luxon architecture

> Architecture diagram of the GitHub repository tonysamperi/ts-luxon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tonysamperi/ts-luxon
- Repository: https://github.com/tonysamperi/ts-luxon

## Overview

TS Luxon is a JavaScript/TypeScript date-and-time library. Its main user workflow creates or parses a DateTime, applies zone and date-time operations, then formats or serializes the result; Duration and Interval provide related value types. Supporting capabilities include locale-aware formatting, zone implementations, and date calculations. Connections are based on the README and SOURCE INDEX references; unsampled implementation details are not inferred beyond those references.

Main entry points: [`src/datetime.ts`](https://github.com/tonysamperi/ts-luxon/blob/master/src/datetime.ts) (DateTime), [`src/duration.ts`](https://github.com/tonysamperi/ts-luxon/blob/master/src/duration.ts) (Duration), [`src/impl/formatter.ts`](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/formatter.ts) (Formatting), [`src/zones/IANAZone.ts`](https://github.com/tonysamperi/ts-luxon/blob/master/src/zones/IANAZone.ts) (IANA Zone)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_values["Date-Time Values"]
  node_datetime["DateTime<br/>[datetime.ts]"]
  node_duration["Duration<br/>[duration.ts]"]
  node_interval["Interval<br/>[interval.ts]"]
  node_info["Date-Time Info<br/>[info.ts]"]
end

subgraph group_intl["Parsing and Intl"]
  node_regex["ISO Parsing<br/>[regexParser.ts]"]
  node_tokens["Token Parsing<br/>[tokenParser.ts]"]
  node_formatter["Formatting<br/>[formatter.ts]"]
  node_locale["Locale Support<br/>[locale.ts]"]
  node_formats["Format Definitions<br/>[formats.ts]"]
end

subgraph group_zones["Zones and Settings"]
  node_zoneapi["Zone Interface<br/>[zone.ts]"]
  node_iana["IANA Zone<br/>[IANAZone.ts]"]
  node_fixed["Fixed-Offset Zone<br/>[fixedOffsetZone.ts]"]
  node_system["System Zone<br/>[systemZone.ts]"]
  node_settings["Global Settings<br/>[settings.ts]"]
end

subgraph group_core["Shared Core"]
  node_util["Date Utilities<br/>[util.ts]"]
  node_diff["Date Differences<br/>[diff.ts]"]
  node_conversions["Calendar Conversions<br/>[conversions.ts]"]
  node_types["Public Types"]
end

node_caller(("Library user"))

node_caller -->|"creates"| node_datetime
node_datetime -->|"parses ISO"| node_regex
node_datetime -->|"uses parser"| node_tokens
node_datetime -->|"uses"| node_duration
node_datetime -->|"uses"| node_interval
node_datetime -->|"formats with"| node_formatter
node_datetime -->|"uses"| node_locale
node_datetime -->|"reads"| node_settings
node_datetime -->|"delegates"| node_diff
node_datetime -->|"uses"| node_conversions
node_datetime -->|"supports zones"| node_iana
node_datetime -->|"supports zones"| node_fixed
node_duration -->|"parses ISO"| node_regex
node_duration -->|"formats with"| node_formatter
node_interval -->|"uses"| node_datetime
node_interval -->|"formats with"| node_formatter
node_info -->|"uses"| node_locale
node_info -->|"uses"| node_zoneapi
node_formatter -->|"uses definitions"| node_formats
node_formatter -->|"uses"| node_locale
node_locale -->|"uses"| node_iana
node_settings -->|"uses"| node_iana
node_settings -->|"uses"| node_system
node_settings -->|"uses"| node_locale
node_iana -->|"implements"| node_zoneapi
node_fixed -->|"implements"| node_zoneapi
node_system -->|"implements"| node_zoneapi
node_iana -->|"uses"| node_util
node_regex -->|"uses"| node_util
node_diff -->|"uses"| node_duration
node_diff -->|"uses"| node_datetime
node_datetime -->|"uses types"| node_types
node_duration -->|"uses types"| node_types

click node_datetime "https://github.com/tonysamperi/ts-luxon/blob/master/src/datetime.ts"
click node_duration "https://github.com/tonysamperi/ts-luxon/blob/master/src/duration.ts"
click node_interval "https://github.com/tonysamperi/ts-luxon/blob/master/src/interval.ts"
click node_info "https://github.com/tonysamperi/ts-luxon/blob/master/src/info.ts"
click node_regex "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/regexParser.ts"
click node_tokens "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/tokenParser.ts"
click node_formatter "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/formatter.ts"
click node_locale "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/locale.ts"
click node_formats "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/formats.ts"
click node_zoneapi "https://github.com/tonysamperi/ts-luxon/blob/master/src/zone.ts"
click node_iana "https://github.com/tonysamperi/ts-luxon/blob/master/src/zones/IANAZone.ts"
click node_fixed "https://github.com/tonysamperi/ts-luxon/blob/master/src/zones/fixedOffsetZone.ts"
click node_system "https://github.com/tonysamperi/ts-luxon/blob/master/src/zones/systemZone.ts"
click node_settings "https://github.com/tonysamperi/ts-luxon/blob/master/src/settings.ts"
click node_util "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/util.ts"
click node_diff "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/diff.ts"
click node_conversions "https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/conversions.ts"
click node_types "https://github.com/tonysamperi/ts-luxon/tree/master/src/types"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_datetime,node_duration,node_interval,node_info,node_caller toneBlue
class node_regex,node_tokens,node_formatter,node_locale,node_formats toneAmber
class node_zoneapi,node_iana,node_fixed,node_system,node_settings toneMint
class node_util,node_diff,node_conversions,node_types toneRose
```

## Components

### Date-Time Values

- [DateTime](https://github.com/tonysamperi/ts-luxon/blob/master/src/datetime.ts): `src/datetime.ts`
- [Duration](https://github.com/tonysamperi/ts-luxon/blob/master/src/duration.ts): `src/duration.ts`
- [Interval](https://github.com/tonysamperi/ts-luxon/blob/master/src/interval.ts): `src/interval.ts`
- [Date-Time Info](https://github.com/tonysamperi/ts-luxon/blob/master/src/info.ts): `src/info.ts`

### Parsing and Intl

- [ISO Parsing](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/regexParser.ts): `src/impl/regexParser.ts`
- [Token Parsing](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/tokenParser.ts): `src/impl/tokenParser.ts`
- [Formatting](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/formatter.ts): `src/impl/formatter.ts`
- [Locale Support](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/locale.ts): `src/impl/locale.ts`
- [Format Definitions](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/formats.ts): `src/impl/formats.ts`

### Zones and Settings

- [Zone Interface](https://github.com/tonysamperi/ts-luxon/blob/master/src/zone.ts): `src/zone.ts`
- [IANA Zone](https://github.com/tonysamperi/ts-luxon/blob/master/src/zones/IANAZone.ts): `src/zones/IANAZone.ts`
- [Fixed-Offset Zone](https://github.com/tonysamperi/ts-luxon/blob/master/src/zones/fixedOffsetZone.ts): `src/zones/fixedOffsetZone.ts`
- [System Zone](https://github.com/tonysamperi/ts-luxon/blob/master/src/zones/systemZone.ts): `src/zones/systemZone.ts`
- [Global Settings](https://github.com/tonysamperi/ts-luxon/blob/master/src/settings.ts): `src/settings.ts`

### Shared Core

- [Date Utilities](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/util.ts): `src/impl/util.ts`
- [Date Differences](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/diff.ts): `src/impl/diff.ts`
- [Calendar Conversions](https://github.com/tonysamperi/ts-luxon/blob/master/src/impl/conversions.ts): `src/impl/conversions.ts`
- [Public Types](https://github.com/tonysamperi/ts-luxon/tree/master/src/types): `src/types`

### Other components

- **Library user**

## Connections

- Library user → DateTime: creates (evidence: `README.md`)
- DateTime → ISO Parsing: parses ISO (evidence: `src/datetime.ts`)
- DateTime → Token Parsing: uses parser (evidence: `src/datetime.ts`)
- DateTime → Duration: uses (evidence: `src/datetime.ts`)
- DateTime → Interval: uses (evidence: `src/datetime.ts`)
- DateTime → Formatting: formats with (evidence: `src/datetime.ts`)
- DateTime → Locale Support: uses (evidence: `src/datetime.ts`)
- DateTime → Global Settings: reads (evidence: `src/datetime.ts`)
- DateTime → Date Differences: delegates (evidence: `src/datetime.ts`)
- DateTime → Calendar Conversions: uses (evidence: `src/datetime.ts`)
- DateTime → IANA Zone: supports zones (evidence: `src/index.ts`)
- DateTime → Fixed-Offset Zone: supports zones (evidence: `src/datetime.ts`)
- Duration → ISO Parsing: parses ISO (evidence: `src/duration.ts`)
- Duration → Formatting: formats with (evidence: `src/impl/formatter.ts`)
- Interval → DateTime: uses (evidence: `src/interval.ts`)
- Interval → Formatting: formats with (evidence: `src/impl/formatter.ts`)
- Date-Time Info → Locale Support: uses (evidence: `src/info.ts`)
- Date-Time Info → Zone Interface: uses (evidence: `src/info.ts`)
- Formatting → Format Definitions: uses definitions (evidence: `src/impl/formatter.ts`)
- Formatting → Locale Support: uses (evidence: `src/impl/formatter.ts`)
- Locale Support → IANA Zone: uses (evidence: `src/impl/locale.ts`)
- Global Settings → IANA Zone: uses (evidence: `src/settings.ts`)
- Global Settings → System Zone: uses (evidence: `src/settings.ts`)
- Global Settings → Locale Support: uses (evidence: `src/settings.ts`)
- IANA Zone → Zone Interface: implements (evidence: `src/zones/IANAZone.ts`)
- Fixed-Offset Zone → Zone Interface: implements (evidence: `src/zones/fixedOffsetZone.ts`)
- System Zone → Zone Interface: implements (evidence: `src/zones/systemZone.ts`)
- IANA Zone → Date Utilities: uses (evidence: `src/zones/IANAZone.ts`)
- ISO Parsing → Date Utilities: uses (evidence: `src/impl/regexParser.ts`)
- Date Differences → Duration: uses (evidence: `src/impl/diff.ts`)
- Date Differences → DateTime: uses (evidence: `src/impl/diff.ts`)
- DateTime → Public Types: uses types (evidence: `src/types/datetime.ts`)
- Duration → Public Types: uses types (evidence: `src/types/duration.ts`)
