Iso8601Duration class
Duration ala ISO 8601.
This is a purposefully simple implementation and is not intended to provide DateTime-style functionality. The main issues is that having months and years makes the duration contextual and we can't then boil it down to seconds (e.g. how many seconds in a month?).
From my reading of Appendix A of RFC 3339, negative values are not allowed.
See:
Properties
- days → int
-
final
- duration → Duration?
-
Returns a Duration representation of this Iso8601Duration.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hours → int
-
final
- minutes → int
-
final
- months → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seconds → int
-
final
- years → int
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
Whether this Iso8601Duration properties are an exact match with
other.override
Static Properties
- iso8601Duration → RegExp
-
final
Static Methods
-
isValid(
String value) → bool -
tryParse(
String input, {int maxInputLength = 24}) → Iso8601Duration? -
Parse an ISO 8601 duration
inputstring into a Iso8601Duration.