Module

JS.Temporal.TemporalUnit

Package
purescript-js-temporal
Repository
pete-murphy/purescript-js-temporal

Units of time used in Temporal arithmetic, rounding, and difference operations. Calendar units (year, month, week) require a calendar reference for conversion; time units (day and smaller) represent fixed durations. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal#temporal_units

#TemporalUnit Source

data TemporalUnit

A unit of time: calendar units (Year, Month, Week), day, or sub-day units.

Constructors

Instances

#toString Source

toString :: TemporalUnit -> String

Converts a TemporalUnit to its JavaScript string value (e.g. Microsecond"microsecond").

#fromString Source

fromString :: String -> Maybe TemporalUnit

Parses a JavaScript temporal unit string. Returns Nothing for unknown values.