PeriodPattern class

Represents a pattern for parsing and formatting Period values.

Implemented types
Annotations
  • @immutable

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

appendFormat(Period value, StringBuffer builder) StringBuffer
Formats the given value as text according to the rules of this pattern, appending to the given StringBuffer.
override
format(Period value) String
Formats the given period as text according to the rules of this pattern.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String text) ParseResult<Period>
Parses the given text value according to the rules of this pattern.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

normalizingIso PeriodPattern
A 'normalizing' pattern which abides by the ISO-8601 duration format as far as possible. Weeks are added to the number of days (after multiplying by 7). Time units are normalized (extending into days where necessary), and fractions of seconds are represented within the seconds part. Unlike ISO-8601, which pattern allows for negative values within a period.
final
roundtrip PeriodPattern
Pattern which uses the normal ISO format for all the supported ISO fields, but extends the time part with 's' for milliseconds, "t" for ticks and "n" for nanoseconds. No normalization is carried out, and a period may contain weeks as well as years, months and days. Each element may also be negative, independently of other elements. This pattern round-trips its values: a parse/format cycle will produce an identical period, including units.
final