Implement --range

This commit is contained in:
Joscha 2021-12-19 00:36:40 +01:00
parent ff627b98df
commit e9ec2998f0
4 changed files with 91 additions and 33 deletions

View file

@ -106,7 +106,11 @@ impl<'a> CommandState<'a> {
.filter(|&until| until < range_until)
.unwrap_or(range_until);
DateRange::new(from, until)
if from <= until {
Some(DateRange::new(from, until))
} else {
None
}
}
/// Add an entry, respecting [`Self::from`] and [`Self::until`]. Does not