Module

Temporal.Internal.Options

Package
purescript-temporal
Repository
philippedev101/purescript-temporal

Option types used across Temporal operations.

These ADTs represent the various option enums from the TC39 Temporal specification. They are converted to JavaScript strings before being passed to the FFI.

#RoundingMode Source

data RoundingMode

Rounding modes matching TC39 Temporal specification.

  • HalfExpand (default) — round half toward positive infinity ("normal" rounding)
  • Ceil — round toward positive infinity
  • Floor — round toward negative infinity
  • Trunc — round toward zero
  • Expand — round away from zero
  • HalfCeil — round half toward positive infinity
  • HalfFloor — round half toward negative infinity
  • HalfTrunc — round half toward zero
  • HalfEven — round half to even (banker's rounding)

Constructors

Instances

#Overflow Source

data Overflow

How to handle out-of-range field values (e.g. day 31 in a 30-day month).

  • Constrain — clamp to the nearest valid value (e.g. day 31 → day 30)
  • Reject — fail (return Nothing)

Most Temporal constructors default to Constrain.

Constructors

Instances

#overflowToString Source

#Disambiguation Source

data Disambiguation

How to resolve wall-clock times that are ambiguous or non-existent due to DST transitions.

  • Compatible (default) — acts like Later for gaps (spring forward) and Earlier for ambiguities (fall back). This matches the behavior of legacy Date.
  • Earlier — pick the earlier of two possible instants
  • Later — pick the later of two possible instants
  • RejectDisambiguation — fail for ambiguous or non-existent times

Constructors

Instances

#OffsetDisambiguation Source

data OffsetDisambiguation

How to resolve conflicts between an explicit UTC offset in a string and the IANA timezone's rules for that instant.

  • Use — trust the offset, ignore timezone rules
  • Ignore — trust the timezone, recompute the offset
  • Prefer — use the offset if it's valid for the timezone, otherwise recompute (good for with operations)
  • RejectOffset — fail if offset and timezone disagree (good for parsing untrusted input)

Constructors

Instances

#TransitionDirection Source

data TransitionDirection

Direction for getTimeZoneTransition queries.

Constructors

Instances

#DateUnit Source

data DateUnit

Units that apply only to date components.

Constructors

Instances

#dateUnitToString Source

#TimeUnit Source

data TimeUnit

Units that apply only to time components.

Constructors

Instances

#timeUnitToString Source

#DateTimeUnit Source

data DateTimeUnit

Combined date+time units for operations that accept either.

Constructors

Instances