From ddb2c314d01373733faec5e783043f5d23eb8145 Mon Sep 17 00:00:00 2001 From: Shautvast Date: Tue, 17 Feb 2026 20:45:21 +0100 Subject: [PATCH] geen timezone --- Cargo.lock | 1 + Cargo.toml | 3 ++- src/inbox.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4a2c2f..3f0e202 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -526,6 +526,7 @@ dependencies = [ "imap", "native-tls", "ratatui", + "regex", "serde", "toml", ] diff --git a/Cargo.toml b/Cargo.toml index 14f94de..aa0bd1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,4 +9,5 @@ crossterm = "0.29" imap = "2.4" native-tls = "0.2" serde = { version = "1.0", features = ["derive"] } -toml = "1.0" \ No newline at end of file +toml = "1.0" +regex = "1.12" \ No newline at end of file diff --git a/src/inbox.rs b/src/inbox.rs index a2f7ea5..a4f1ddd 100644 --- a/src/inbox.rs +++ b/src/inbox.rs @@ -1,3 +1,4 @@ +use regex::Regex; use crate::config::Config; use crate::connect::ImapSession; use crate::{connect, Email}; @@ -72,7 +73,7 @@ fn parse_emails(fetches: &[imap::types::Fetch]) -> Vec { } else if let Some(val) = line.strip_prefix("From: ") { from = val.to_string(); } else if let Some(val) = line.strip_prefix("Date: ") { - date = val.to_string(); + date = Regex::new(r#" \(...\)$"#).unwrap().replace_all(val, "").to_string(); } }