Interval.parse constructor
Interval.parse(
- String text
An interval of a string ("../
Start and end instants must be formatted according to RFC 3339. See
DateTime.parse
for reference of valid inputs for start and end parts.
Throws FormatException if an interval cannot be parsed.
Implementation
factory Interval.parse(String text) {
final parts = text.split('/');
if (parts.length == 2) {
return Interval.fromJson([parts[0], parts[1]]);
}
throw FormatException('Invalid interval "$text".');
}