diff --git a/Cargo.lock b/Cargo.lock index 097ee330..2304b408 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,11 +200,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1016,12 +1022,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.4.2", "cfg-if", + "cfg_aliases", "libc", ] @@ -1483,9 +1490,9 @@ dependencies = [ [[package]] name = "rustyline" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a2d683a4ac90aeef5b1013933f6d977bd37d51ff3f4dad829d4931a7e6be86" +checksum = "7803e8936da37efd9b6d4478277f4b2b9bb5cdb37a113e8d63222e58da647e63" dependencies = [ "bitflags 2.4.2", "cfg-if", @@ -1500,7 +1507,7 @@ dependencies = [ "unicode-segmentation", "unicode-width", "utf8parse", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -2150,28 +2157,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index e7dcded4..d6a25a48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ nu-ansi-term = "0.50" rand = "0.8" rbase64 = "2.0" regex = "1.1" -rustyline = "13.0.0" +rustyline = "14.0.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/src/searcher.rs b/src/searcher.rs index ed0bb645..3b2ba3d5 100644 --- a/src/searcher.rs +++ b/src/searcher.rs @@ -1753,9 +1753,9 @@ impl <'a> Searcher<'a> { }, VariantType::DateTime => { let (start, finish) = value.to_datetime(); - let start = start.timestamp(); - let finish = finish.timestamp(); - let dt = field_value.to_datetime().0.timestamp(); + let start = start.and_utc().timestamp(); + let finish = finish.and_utc().timestamp(); + let dt = field_value.to_datetime().0.and_utc().timestamp(); match op { Op::Eeq => dt == start, Op::Ene => dt != start, diff --git a/src/util/datetime.rs b/src/util/datetime.rs index 3353a120..a53f11e3 100644 --- a/src/util/datetime.rs +++ b/src/util/datetime.rs @@ -23,7 +23,7 @@ pub fn parse_datetime(s: &str) -> Result<(NaiveDateTime, NaiveDateTime), String> } if s == "yesterday" { - let date = Local::now().date_naive() - Duration::days(1); + let date = Local::now().date_naive() - Duration::try_days(1).unwrap(); let start = date.and_hms_opt(0, 0, 0).unwrap(); let finish = date.and_hms_opt(23, 59, 59).unwrap();