Implement formula evaluation for DATE statement

This commit is contained in:
Joscha 2021-12-06 12:47:19 +00:00
parent c391d76690
commit cb7c87b8b2
7 changed files with 237 additions and 30 deletions

View file

@ -40,6 +40,11 @@ impl DateRange {
self.until
}
pub fn days(&self) -> impl Iterator<Item = NaiveDate> {
(self.from.num_days_from_ce()..=self.until.num_days_from_ce())
.map(|n| NaiveDate::from_num_days_from_ce(n))
}
pub fn years(&self) -> RangeInclusive<i32> {
self.from.year()..=self.until.year()
}