DateRange.between

time.DateRange.between(min_date, max_date)

Compute a new DateRange that represents the subset of dates in this range that are also between min_date and max_date (inclusive).

Parameters

min_date: date

The earliest date to include in the subset.

max_date: date

The latest date to include in the subset.

Returns

DateRange | None

The subset DateRange, or None if that subset would be empty – when there’s no overlap between this DateRange and the min/max dates.