docs: def end_datetime(self) -> Optional[datetime.datetime]:
          """
          Returns the end date of the set of intervals, or ``None`` if empty.
          """
          if not self.intervals:
              return None
          return max([x.end for x in self.intervals])