Module

JS.Temporal.PlainTime

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

A wall-clock time (hour, minute, second, etc.) without date or time zone. Use for recurring times (e.g. "3:30 PM") or when combining with PlainDate.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainTime

#new Source

new :: forall provided rest. Union provided rest PlainTimeComponents => Record provided -> Effect PlainTime

Creates a PlainTime from component fields. Corresponds to Temporal.PlainTime().

#from Source

from :: forall provided. ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record provided) (Record OverflowOptions) => Record provided -> String -> Effect PlainTime

Parses a time string (e.g. "15:30:00"). Options: overflow. Throws on invalid input.

#from_ Source

from_ :: String -> Effect PlainTime

Same as from with default options.

#millisecond Source

#microsecond Source

#add Source

add :: Duration -> PlainTime -> Effect PlainTime

Adds a duration. Wraps at 24 hours. Throws for calendar durations.

#subtract Source

subtract :: Duration -> PlainTime -> Effect PlainTime

Subtracts a duration. Wraps at 24 hours. Throws for calendar durations.

#with Source

with :: forall optsProvided fields rest. Union fields rest WithFields => ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record optsProvided) (Record OverflowOptions) => Record optsProvided -> Record fields -> PlainTime -> Effect PlainTime

Returns a new PlainTime with specified fields replaced. Options: overflow.

#with_ Source

with_ :: forall fields rest. Union fields rest WithFields => Record fields -> PlainTime -> Effect PlainTime

Same as with with default options.

#until Source

until :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> PlainTime -> PlainTime -> Effect Duration

Duration from this time until the other (positive if other is later same day).

#until_ Source

until_ :: PlainTime -> PlainTime -> Effect Duration

Same as until with default options.

#since Source

since :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> PlainTime -> PlainTime -> Effect Duration

Duration from the other time to this one (inverse of until).

#since_ Source

since_ :: PlainTime -> PlainTime -> Effect Duration

Same as since with default options.

#round Source

round :: forall provided. ConvertOptionsWithDefaults ToRoundOptions (Record RoundOptions) (Record provided) (Record RoundOptions) => Record provided -> PlainTime -> Effect PlainTime

Rounds the time to the given smallest unit.

#fromTime Source

fromTime :: Time -> Effect PlainTime

Converts a purescript-datetime Time to a PlainTime. Microsecond and nanosecond components are set to zero. See docs/purescript-datetime-interop.md.

#toTime Source

toTime :: PlainTime -> Time

Converts a PlainTime to a purescript-datetime Time. Microsecond and nanosecond are dropped (treated as zero). See docs/purescript-datetime-interop.md.

#toString Source

toString :: forall provided. ConvertOptionsWithDefaults ToToStringOptions (Record ToStringOptions) (Record provided) (Record ToStringOptions) => Record provided -> PlainTime -> String

Serializes to ISO 8601 time format. Options: fractionalSecondDigits, smallestUnit, roundingMode.

#toString_ Source

toString_ :: PlainTime -> String

Default ISO 8601 serialization (no options). Prefer over toString {}.

Re-exports from JS.Temporal.PlainTime.Internal