From f097593bedef7d5af5399630a93cdd3a4d98c77c Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Mon, 19 Jul 2021 03:52:09 +0300 Subject: [PATCH] melib/datetime: fix date format string --- melib/src/datetime.rs | 1 + melib/src/email/compose.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/melib/src/datetime.rs b/melib/src/datetime.rs index 47799ee6..124d6486 100644 --- a/melib/src/datetime.rs +++ b/melib/src/datetime.rs @@ -45,6 +45,7 @@ use std::ffi::{CStr, CString}; pub type UnixTimestamp = u64; pub const RFC3339_FMT_WITH_TIME: &str = "%Y-%m-%dT%H:%M:%S\0"; pub const RFC3339_FMT: &str = "%Y-%m-%d\0"; +pub const RFC822_DATE: &str = "%a, %d %b %Y %H:%M:%S %z\0"; pub const RFC822_FMT_WITH_TIME: &str = "%a, %e %h %Y %H:%M:%S \0"; pub const RFC822_FMT: &str = "%e %h %Y %H:%M:%S \0"; pub const DEFAULT_FMT: &str = "%a, %d %b %Y %R\0"; diff --git a/melib/src/email/compose.rs b/melib/src/email/compose.rs index c6f860a3..bdbd8edd 100644 --- a/melib/src/email/compose.rs +++ b/melib/src/email/compose.rs @@ -53,7 +53,11 @@ impl Default for Draft { let mut headers = HeaderMap::default(); headers.insert( HeaderName::new_unchecked("Date"), - crate::datetime::timestamp_to_string(crate::datetime::now(), None, true), + crate::datetime::timestamp_to_string( + crate::datetime::now(), + Some(crate::datetime::RFC822_DATE), + true, + ), ); headers.insert(HeaderName::new_unchecked("From"), "".into()); headers.insert(HeaderName::new_unchecked("To"), "".into());