DurationExtensions extension

Extension methods for Duration class

on

Properties

formattedCountdown String

Available on Duration, provided by the DurationExtensions extension

Get countdown formatted string representation
no setter
formattedHHMMSS String

Available on Duration, provided by the DurationExtensions extension

Get formatted string representation as HH:MM:SS
no setter
formattedMMSS String

Available on Duration, provided by the DurationExtensions extension

Get formatted string representation as MM:SS
no setter
formattedShortWords String

Available on Duration, provided by the DurationExtensions extension

Get formatted string representation with short words
no setter
formattedSmart String

Available on Duration, provided by the DurationExtensions extension

Get smart formatted string representation
no setter
formattedSS String

Available on Duration, provided by the DurationExtensions extension

Get formatted string representation as SS
no setter
formattedWithFullMilliseconds String

Available on Duration, provided by the DurationExtensions extension

Get formatted string representation with full milliseconds
no setter
formattedWithMilliseconds String

Available on Duration, provided by the DurationExtensions extension

Get formatted string representation with milliseconds
no setter
formattedWords String

Available on Duration, provided by the DurationExtensions extension

Get formatted string representation with words
no setter
humanReadable String

Available on Duration, provided by the DurationExtensions extension

Get duration as a human-readable string
no setter
humanReadableShort String

Available on Duration, provided by the DurationExtensions extension

Get duration as a short human-readable string
no setter
inHoursAsDouble double

Available on Duration, provided by the DurationExtensions extension

Get duration in hours as double
no setter
inMinutesAsDouble double

Available on Duration, provided by the DurationExtensions extension

Get duration in minutes as double
no setter
inSecondsAsDouble double

Available on Duration, provided by the DurationExtensions extension

Get duration in seconds as double
no setter
isNegative bool

Available on Duration, provided by the DurationExtensions extension

Check if duration is negative
no setter
isPositive bool

Available on Duration, provided by the DurationExtensions extension

Check if duration is positive
no setter
isZero bool

Available on Duration, provided by the DurationExtensions extension

Check if duration is zero
no setter
remainingHours int

Available on Duration, provided by the DurationExtensions extension

Get remaining hours
no setter
remainingMilliseconds int

Available on Duration, provided by the DurationExtensions extension

Get remaining milliseconds (excluding seconds)
no setter
remainingMinutes int

Available on Duration, provided by the DurationExtensions extension

Get remaining minutes (excluding hours)
no setter
remainingSeconds int

Available on Duration, provided by the DurationExtensions extension

Get remaining seconds (excluding minutes)
no setter

Methods

clamp(Duration min, Duration max) Duration

Available on Duration, provided by the DurationExtensions extension

Clamp duration between min and max values
getProgress(Duration totalDuration) double

Available on Duration, provided by the DurationExtensions extension

Get progress value (0.0 to 1.0) based on total duration
max(Duration other) Duration

Available on Duration, provided by the DurationExtensions extension

Get the maximum of two durations
min(Duration other) Duration

Available on Duration, provided by the DurationExtensions extension

Get the minimum of two durations

Operators

operator *(double factor) Duration

Available on Duration, provided by the DurationExtensions extension

Multiply duration by a factor
operator +(Duration other) Duration

Available on Duration, provided by the DurationExtensions extension

Add another duration
operator -(Duration other) Duration

Available on Duration, provided by the DurationExtensions extension

Subtract another duration
operator /(double factor) Duration

Available on Duration, provided by the DurationExtensions extension

Divide duration by a factor
operator <(Duration other) bool

Available on Duration, provided by the DurationExtensions extension

Check if duration is less than another
operator <=(Duration other) bool

Available on Duration, provided by the DurationExtensions extension

Check if duration is less than or equal to another
operator >(Duration other) bool

Available on Duration, provided by the DurationExtensions extension

Check if duration is greater than another
operator >=(Duration other) bool

Available on Duration, provided by the DurationExtensions extension

Check if duration is greater than or equal to another