PrecisionExt extension

Extension providing precision operations for Hora.

on

Methods

alignTo(int interval, TimePrecision precision) → Hora

Available on Hora, provided by the PrecisionExt extension

Aligns this date to a grid of the specified interval.
diffWithPrecision(Hora other, {required TimePrecision precision}) → int

Available on Hora, provided by the PrecisionExt extension

Computes the difference with precision-aware truncation.
isAfterWithPrecision(Hora other, {required TimePrecision precision}) → bool

Available on Hora, provided by the PrecisionExt extension

Checks if this date is after another with the given precision.
isBeforeWithPrecision(Hora other, {required TimePrecision precision}) → bool

Available on Hora, provided by the PrecisionExt extension

Checks if this date is before another with the given precision.
isSameAs(Hora other, {required TimePrecision precision}) → bool

Available on Hora, provided by the PrecisionExt extension

Checks if this date is the same as another with the given precision.
nearestBoundary(TimePrecision precision) → Hora

Available on Hora, provided by the PrecisionExt extension

Gets the nearest precision boundary.
roundTo(TimePrecision precision, {RoundingMode mode = RoundingMode.round}) → Hora

Available on Hora, provided by the PrecisionExt extension

Rounds this date to the given precision.
truncateTo(TimePrecision precision) → Hora

Available on Hora, provided by the PrecisionExt extension

Truncates this date to the given precision.
withPrecision(TimePrecision precision) → Hora

Available on Hora, provided by the PrecisionExt extension

Creates a Hora with only the specified precision components.