operator | method

List<Period> operator |(
  1. Period other
)

Returns a list of Periods.

If other overlaps with this, the returned list will contain the union of the two Periods. Starting at the earliest Period.start and ending at the latest Period.end.

If other does not overlap with this, the returned list will contain both this and other.

Implementation

List<Period> operator |(Period other) {
  return [
    ...mergeWith(other)?.apply((self) => [self]) ?? [this, other],
  ];
}