diff options
| -rw-r--r-- | cli/src/search.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/src/search.rs b/cli/src/search.rs index a5e0309..0ad14ea 100644 --- a/cli/src/search.rs +++ b/cli/src/search.rs @@ -42,7 +42,7 @@ pub enum Constraint { Category(Category), Before(DateIsh), After(DateIsh), - //TODO On(DateIsh) + On(DateIsh) } enum FilterType { @@ -113,6 +113,11 @@ impl FilterType { FilterType::Union(Constraint::After(date)) => transaction.date >= date.clone().get(), + + FilterType::Intersect(Constraint::On(date)) + | FilterType::Subtract(Constraint::On(date)) + | FilterType::Union(Constraint::On(date)) + => transaction.date == date.clone().get(), } } } @@ -151,6 +156,7 @@ impl<'t> Search<'t> { ("category", category) => Constraint::Category(category.to_string()), ("before", date_ish) => Constraint::Before(DateIsh::parse(date_ish)), ("after", date_ish) => Constraint::After(DateIsh::parse(date_ish)), + ("on", date_ish) => Constraint::On(DateIsh::parse(date_ish)), _ => panic!(), }; |
