Browse Source

melib/datetime: fix date format string

master
Manos Pitsidianakis 5 months ago
parent
commit
f097593bed
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 1
      melib/src/datetime.rs
  2. 6
      melib/src/email/compose.rs

1
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";

6
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());

Loading…
Cancel
Save