temporal-fns
    Preparing search index...

    Function intervalToDuration

    • Returns the Duration from interval.start to interval.end.

      The default largestUnit is opinionated for each input type — "year" for date-bearing types (PlainDate, PlainDateTime, ZonedDateTime) and "hour" for Instant / PlainTime — so the result reads naturally without further configuration. Pass options to override.

      options accepts the same shape as Temporal's .until() rounding options, including smallestUnit, roundingIncrement, and roundingMode.

      Parameters

      • interval: Interval<Instant>
      • Optionaloptions: RoundingOptionsWithLargestUnit<TimeUnit>

      Returns Duration

    • Returns the Duration from interval.start to interval.end.

      The default largestUnit is opinionated for each input type — "year" for date-bearing types (PlainDate, PlainDateTime, ZonedDateTime) and "hour" for Instant / PlainTime — so the result reads naturally without further configuration. Pass options to override.

      options accepts the same shape as Temporal's .until() rounding options, including smallestUnit, roundingIncrement, and roundingMode.

      Parameters

      • interval: Interval<ZonedDateTime>
      • Optionaloptions: RoundingOptionsWithLargestUnit<TimeUnit | DateUnit>

      Returns Duration

    • Returns the Duration from interval.start to interval.end.

      The default largestUnit is opinionated for each input type — "year" for date-bearing types (PlainDate, PlainDateTime, ZonedDateTime) and "hour" for Instant / PlainTime — so the result reads naturally without further configuration. Pass options to override.

      options accepts the same shape as Temporal's .until() rounding options, including smallestUnit, roundingIncrement, and roundingMode.

      Parameters

      • interval: Interval<PlainDateTime>
      • Optionaloptions: RoundingOptionsWithLargestUnit<TimeUnit | DateUnit>

      Returns Duration

    • Returns the Duration from interval.start to interval.end.

      The default largestUnit is opinionated for each input type — "year" for date-bearing types (PlainDate, PlainDateTime, ZonedDateTime) and "hour" for Instant / PlainTime — so the result reads naturally without further configuration. Pass options to override.

      options accepts the same shape as Temporal's .until() rounding options, including smallestUnit, roundingIncrement, and roundingMode.

      Parameters

      • interval: Interval<PlainDate>
      • Optionaloptions: RoundingOptionsWithLargestUnit<DateUnit>

      Returns Duration

    • Returns the Duration from interval.start to interval.end.

      The default largestUnit is opinionated for each input type — "year" for date-bearing types (PlainDate, PlainDateTime, ZonedDateTime) and "hour" for Instant / PlainTime — so the result reads naturally without further configuration. Pass options to override.

      options accepts the same shape as Temporal's .until() rounding options, including smallestUnit, roundingIncrement, and roundingMode.

      Parameters

      • interval: Interval<PlainTime>
      • Optionaloptions: RoundingOptionsWithLargestUnit<TimeUnit>

      Returns Duration