cut method

List<Timespan> cut(
  1. DateTime time
)

Returns a list of two Timespans. If time is not in this it throws an error

Implementation

List<Timespan> cut(DateTime time) => (time.isIn(this))
    ? [Timespan(begin: begin, end: time), Timespan(begin: time, end: end)]
    : throw ArgumentError("Given time is not inside timespan");