diff options
Diffstat (limited to 'src/filters.rs')
-rw-r--r-- | src/filters.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/filters.rs b/src/filters.rs index ef8bfad..d8d43ea 100644 --- a/src/filters.rs +++ b/src/filters.rs @@ -2,6 +2,8 @@ use evtclib::{AgentName, Log}; use super::{SearchField, LogResult, Opt}; +use chrono::Datelike; + /// Do filtering based on the character or account name. pub fn filter_name(log: &Log, opt: &Opt) -> bool { for player in log.players() { @@ -28,6 +30,11 @@ pub fn filter_outcome(result: &LogResult, opt: &Opt) -> bool { opt.outcome.contains(&result.outcome) } +/// Do filtering based on the weekday of the fight. +pub fn filter_weekday(result: &LogResult, opt: &Opt) -> bool { + opt.weekdays.contains(&result.time.weekday()) +} + /// Do filtering based on encounter time. pub fn filter_time(result: &LogResult, opt: &Opt) -> bool { let after_ok = match opt.after { |