date formatting
This commit is contained in:
7
axum_server/src/filters.rs
Normal file
7
axum_server/src/filters.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
// This filter does not have extra arguments
|
||||
pub fn pretty_date(date_time: &DateTime<Utc>) -> ::askama::Result<String> {
|
||||
let formatted = format!("{}", date_time.format("%e %B %Y"));
|
||||
Ok(formatted)
|
||||
}
|
@ -5,6 +5,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
mod components;
|
||||
mod feed;
|
||||
mod filters;
|
||||
mod pages;
|
||||
mod post_list;
|
||||
mod post_parser;
|
||||
|
@ -6,6 +6,7 @@ use crate::{
|
||||
site_footer::{render_site_footer, SiteFooter},
|
||||
site_header::{HeaderProps, Link},
|
||||
},
|
||||
filters,
|
||||
post_list::get_post_list,
|
||||
post_parser::ParseResult,
|
||||
};
|
||||
|
Reference in New Issue
Block a user