expandOther method

DateTimeRange expandOther(
  1. DateTimeRange other
)

Implementation

DateTimeRange expandOther(DateTimeRange other) {
  if (other.start.isBefore(start) && other.end.isAfter(end)) {
    return copyWith(start: other.start, end: other.end);
  } else if (other.start.isBefore(start)) {
    return copyWith(start: other.start);
  } else if (other.end.isAfter(end)) {
    return copyWith(end: other.end);
  }
  return this;
}