TimeDuration
Index
Codec
Comparator
Constructor
Formatting
Numeric
Type
Other
Codec
__decode__
Returns the decoded
input
,Result.Ok
orResult.Error()
__encode__
Returns the encoded
input
__schema__
Returns the JSONSchema corresponding to the decoded type
Comparator
!=
"Not equal to" operator
<
"Less than" operator
<=
"Less than or equal to" operator
==
"Equal to" operator
>
"Greater than" operator
>=
"Greater than or equal to" operator
clamp
Clamp value between minValue and maxValue
compare
Return an Ordering that represents comparison result
equals
Alias to '=='
max
"maximum" operator
min
"minimum" operator
Constructor
days
Return a duration of
amount
days
hours
Return a duration of
amount
hours
milliseconds
Return a duration of
amount
milliseconds
minutes
Return a duration of
amount
minutes
of
Return a duration from a number
seconds
Return a duration of
amount
seconds
weeks
Return a duration of
amount
days
Formatting
asString
Converts the given value to a String.
Numeric
*
Multiplication operator
+
Addition operator
-
Subtraction operator
abs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == x
isNegative
Returns true if the number is negative and false if the number is zero or positive.
isPositive
Returns true if the number is positive and false if the number is zero or negative.
negate
Negates the given value.
sign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == x
Type
__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
asInstance
Try to convert anyValue to enum value or else returns
Option.None
hasInstance
Return
true
if the given value is an instance of the class.
Other
typeName
__call__
Converts a number or a TimeDurationObject to a TimeDuration
from
Converts a number or a TimeDurationObject to a TimeDuration
toDays
Converts a time duration to days.
toHours
Converts a time duration to hours.
toMinutes
Converts a time duration to minutes.
toSeconds
Converts a time duration to seconds.
toWeeks
Converts a time duration to weeks.
unwrap
Convert a tagged value to the underlying type
wrap
Convert an underlying type to a tagged type
A collection of functions to manipulate time duration (i.e amount of milliseconds)