TimezoneRange constructor
TimezoneRange({
- required HoraZoned start,
- required HoraZoned end,
- required HoraTimezone timezone,
Implementation
TimezoneRange({
required this.start,
required this.end,
required this.timezone,
}) {
if (start.timezone != timezone || end.timezone != timezone) {
throw ArgumentError(
'start/end timezone must match range timezone.',
);
}
if (end.instantUtc.isBefore(start.instantUtc)) {
throw ArgumentError(
'Range end must be the same as or after start instant.',
);
}
}