# Data flow — moment/luxon

> Canonical page: https://codevetter.com/unpack/luxon/data-flow

# Data flow — moment/luxon

Scanned commit f427515a38f6a671f8de663e6bcc040ed81f114e (2026-08-09). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Inputs enter through explicit factories and are normalized into calendar fields, unit quantities, or endpoints. Parsing carries extracted zones separately from date fields before construction resolves defaults, validates data, and computes a timestamp. Transformations create new temporal objects, with calendar arithmetic distinguished from elapsed-time arithmetic. Output methods emit strings, numbers, objects, or native Dates; durable storage remains the caller's responsibility.
- normalizeObject processes own properties, skips null/undefined values, canonicalizes unit names, and coerces numbers; asNumber rejects booleans, empty strings, and non-finite results. — [src/impl/util.js#L290-L306](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/util.js#L290-L306) [src/datetime.js#L811-L813](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L811-L813) [src/duration.js#L262-L267](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/duration.js#L262-L267)
- ISO parsing tries anchored Gregorian, week, ordinal, and time patterns, returning fields and a Zone; parseDataToDateTime interprets in the parsed zone and converts to the requested/default zone unless setZone is true. — [src/impl/regexParser.js#L25-L54](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/regexParser.js#L25-L54) [src/impl/regexParser.js#L288-L295](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/regexParser.js#L288-L295) [src/datetime.js#L192-L205](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L192-L205)
- Custom-format input becomes parsed tokens, macro expansions, regex handlers, and matched fields; parseFromTokens forwards result, zone, specificOffset, and invalidReason into DateTime construction. — [src/impl/tokenParser.js#L439-L477](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/tokenParser.js#L439-L477) [src/impl/tokenParser.js#L495-L497](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/tokenParser.js#L495-L497) [src/datetime.js#L998-L1008](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L998-L1008)
- fromObject fills omitted higher-order fields from the current/reference date and lower-order fields from defaults, validates the selected calendar, then converts week/ordinal values to Gregorian fields and resolves timestamp/offset. — [src/datetime.js#L815-L823](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L815-L823) [src/datetime.js#L841-L899](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L841-L899) [src/impl/conversions.js#L146-L206](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/conversions.js#L146-L206)
- DateTime owns ts, zone, locale, calendar fields, offset, validity, and wasHole; clone carries these forward into a new instance and the constructor reuses derived fields when timestamp and zone are unchanged. — [src/datetime.js#L90-L100](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L90-L100) [src/datetime.js#L554-L619](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L554-L619)
- plus/minus normalize duration-like inputs; adjustTime changes calendar fields first, resolves DST, adds residual elapsed milliseconds, and recalculates the offset after that addition. — [src/datetime.js#L153-L187](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L153-L187) [src/datetime.js#L1714-L1729](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L1714-L1729) [src/duration.js#L280-L291](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/duration.js#L280-L291)
- Localized output flows through Formatter, Locale.dtFormatter, and cached Intl.DateTimeFormat instances; unsupported fixed/custom zones are represented via shifted UTC Dates and substituted zone-name parts. — [src/impl/formatter.js#L108-L117](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/formatter.js#L108-L117) [src/impl/locale.js#L21-L28](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/locale.js#L21-L28) [src/impl/locale.js#L223-L266](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/locale.js#L223-L266) [src/impl/locale.js#L269-L298](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/impl/locale.js#L269-L298)
- DateTime.toJSON emits ISO text and toBSON emits a native Date; Duration.toJSON emits ISO duration text, while Interval.toISO emits start/end strings, so these paths transfer values without writing application storage. — [src/datetime.js#L2133-L2146](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/datetime.js#L2133-L2146) [src/duration.js#L582-L591](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/duration.js#L582-L591) [src/interval.js#L621-L624](https://github.com/moment/luxon/blob/f427515a38f6a671f8de663e6bcc040ed81f114e/src/interval.js#L621-L624)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
