mirror of https://github.com/hamaluik/mkbook
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
323 B
Rust
14 lines
323 B
Rust
use chrono::prelude::*;
|
|
|
|
pub fn rfc3339_utc(d: &DateTime<Utc>) -> askama::Result<String> {
|
|
Ok(d.to_rfc3339())
|
|
}
|
|
|
|
pub fn human_date(d: &DateTime<Utc>) -> askama::Result<String> {
|
|
Ok(d.format("%b %e, %Y").to_string())
|
|
}
|
|
|
|
pub fn year(d: &DateTime<Utc>) -> askama::Result<String> {
|
|
Ok(d.format("%Y").to_string())
|
|
}
|