diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-08-04 22:01:07 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-08-04 22:01:07 +0200 |
| commit | bcd5944116f912e06d4a4528eac7d330196c994c (patch) | |
| tree | 6df919d12a8fb9d694f6befc8dc178e1e145120f | |
| parent | 75c238343b8868bc7ff060bee6c99f2d30faee3b (diff) | |
| download | money-bcd5944116f912e06d4a4528eac7d330196c994c.tar.gz | |
today()
| -rw-r--r-- | cli/src/search.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/src/search.rs b/cli/src/search.rs index 972913f..c01e9c6 100644 --- a/cli/src/search.rs +++ b/cli/src/search.rs @@ -46,7 +46,7 @@ impl DateIsh { pub fn get(self) -> NaiveDate { match self { DateIsh::Absolute(date) => date, - DateIsh::Relative(offset) => chrono::offset::Local::today().naive_utc() + offset, + DateIsh::Relative(offset) => today() + offset, } } } @@ -156,6 +156,10 @@ impl Constraint { } } +fn today() -> NaiveDate { + chrono::Local::today().naive_utc() +} + fn filter_between(start: NaiveDate, end: NaiveDate) -> Vec<Filter> { vec