TimeOfDayExtensions extension

Convenience methods on TimeOfDay.

on

Methods

ceil() TimeOfDay

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Creates a new TimeOfDay from this by updating minute to 59.
ceilToInterval(int minuteInterval) TimeOfDay

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Creates copy of this with the minute value rounded to the least minute value that is divisible by minuteInterval but is not smaller than current minute value.
clamp(TimeOfDay? minimum, TimeOfDay? maximum) TimeOfDay

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Clamps this object to be within the specified time range minimum-maximum. If this is already within the range, it is returned unchanged. If this is not within the range, the function returns the closest valid TimeOfDay within the range. The function also supports time ranges that span across midnight.
floor() TimeOfDay

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Creates a new TimeOfDay from this by updating minute to 0.
floorToInterval(int minuteInterval) TimeOfDay

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Creates copy of this with the minute value rounded to the greatest minute value that is divisible by minuteInterval but no greater than the current minute value.
isAfter(TimeOfDay other) bool

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Returns true if this occurs after other.
isBefore(TimeOfDay other) bool

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Returns true if this occurs before other.
isInRange(TimeOfDay start, TimeOfDay end) bool

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Returns true if this occurs in range start-end.
roundToInterval(int minuteInterval) TimeOfDay

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Creates copy of this with the minute value rounded to the closest minute value that is divisible by minuteInterval.
toMinutes() int

Available on TimeOfDay, provided by the TimeOfDayExtensions extension

Converts this to minutes.