geen timezone
This commit is contained in:
parent
1412ecfbb8
commit
ddb2c314d0
3 changed files with 5 additions and 2 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -526,6 +526,7 @@ dependencies = [
|
||||||
"imap",
|
"imap",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
"ratatui",
|
"ratatui",
|
||||||
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
"toml",
|
"toml",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,5 @@ crossterm = "0.29"
|
||||||
imap = "2.4"
|
imap = "2.4"
|
||||||
native-tls = "0.2"
|
native-tls = "0.2"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
toml = "1.0"
|
toml = "1.0"
|
||||||
|
regex = "1.12"
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
use regex::Regex;
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::connect::ImapSession;
|
use crate::connect::ImapSession;
|
||||||
use crate::{connect, Email};
|
use crate::{connect, Email};
|
||||||
|
|
@ -72,7 +73,7 @@ fn parse_emails(fetches: &[imap::types::Fetch]) -> Vec<Email> {
|
||||||
} else if let Some(val) = line.strip_prefix("From: ") {
|
} else if let Some(val) = line.strip_prefix("From: ") {
|
||||||
from = val.to_string();
|
from = val.to_string();
|
||||||
} else if let Some(val) = line.strip_prefix("Date: ") {
|
} else if let Some(val) = line.strip_prefix("Date: ") {
|
||||||
date = val.to_string();
|
date = Regex::new(r#" \(...\)$"#).unwrap().replace_all(val, "").to_string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue