Module

Temporal.Interval.Duration

Package
purescript-temporal
Repository
philippedev101/purescript-temporal

Typeclass for computing the duration of an interval.

Provides HasDuration instances for all Temporal types that support until', and a duration function that computes the duration of an Interval using that typeclass.

#HasDuration Source

class HasDuration a  where

Types that support computing a Duration between two values.

Members

Instances

#duration Source

duration :: forall a. HasDuration a => Interval a -> Duration

Compute the duration of an interval using the until' function of the contained type.

duration (unsafeInterval date1 date2)  -- uses PlainDate.until'
duration (unsafeInterval zdt1 zdt2)    -- uses ZonedDateTime.until' (DST-aware)