atom: add posted date

This commit is contained in:
Cadey Ratio 2020-07-14 16:09:26 -04:00
parent e4a316327f
commit 7d5d62efba
1 changed files with 8 additions and 7 deletions

View File

@ -62,13 +62,14 @@ impl Into<atom::Entry> for Post {
link.href = format!("https://christine.website/{}", self.link);
result.links(vec![link]);
result.content(content);
// result.published(Some(
// DateTime::<Utc>::from_utc(
// NaiveDateTime::new(self.date, NaiveTime::from_hms(0, 0, 0)),
// Utc,
// )
// .with_timezone(&Utc),
// ));
result.published(Some(
DateTime::<Utc>::from_utc(
NaiveDateTime::new(self.date, NaiveTime::from_hms(0, 0, 0)),
Utc,
)
.with_timezone(&Utc)
.into(),
));
result.build().unwrap()
}