time_span library

Classes

TimeSpan
Represents a user-defined duration. Unlike Duration, this class does not normalize down to microseconds value, but preserves the original precision.

Extensions

TimeSpanUnitExt

Constants

numberPattern → const String
"?:([-+]?[0-9]+(?:[.,][0-9]{0,9})?)"
spanPattern → const String
"($numberPattern)([a-z]+)"

Properties

dateUnits List<TimeSpanUnit>
final
defaultLabels Map<TimeSpanUnit, String>
final
durationPattern String
final
durationRegex RegExp
final
equalsChecker DeepCollectionEquality
final
knownSpans Map<String, TimeSpan>
final
knownSpanUnits Map<String, TimeSpanUnit>
final
shortLabels Map<TimeSpanUnit, String>
final
spanRegex RegExp
Not used for the ISO parsing, but this helps us in our parsing to find tokens like "3y"
final
timeUnits List<TimeSpanUnit>
final

Functions

cloneDate(DateTime orig, {int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond}) DateTime
timeSpanUnitOf(dynamic input) TimeSpanUnit
tryParseTimeSpanUnit(dynamic input) List<TimeSpanUnit>

Enums

TimeSpanUnit

Typedefs

TimeSpanValue(TimeSpan span) num