Skip to main content

resolve_date_range

Function resolve_date_range 

Source
pub fn resolve_date_range(
    since: Option<NaiveDate>,
    until: Option<NaiveDate>,
    period: Option<&str>,
) -> Result<(NaiveDate, NaiveDate), String>
Expand description

Resolve a (--since, --until, --period) triple into an inclusive date range.

Precedence: period wins when supplied. Otherwise since + until are used (with until defaulting to today’s local date when absent). When all three are None, the range is unbounded (NaiveDate::MIN..=NaiveDate::MAX).

Errors when since is strictly after until.