aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@christine.website>2022-07-04 14:44:09 +0000
committerXe Iaso <me@christine.website>2022-07-04 14:44:09 +0000
commit5d7daf179ee80f9f2be5345164a419fab051a651 (patch)
treedfdddec82a768c8b472d9ed078258e0225aeea22
parent6be8b24dd293e3d48eafc37cecf1d98971be81f8 (diff)
downloadxesite-5d7daf179ee80f9f2be5345164a419fab051a651.tar.xz
xesite-5d7daf179ee80f9f2be5345164a419fab051a651.zip
handlers: fix LAST_MODIFIED date format
Closes #463 Signed-off-by: Xe <me@christine.website>
-rw-r--r--src/handlers/mod.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index fc2a154..974d914 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -33,6 +33,24 @@ fn weekday_to_name(w: Weekday) -> &'static str {
}
}
+fn month_to_name(m: u32) -> &'static str {
+ match m {
+ 1 => "Jan",
+ 2 => "Feb",
+ 3 => "Mar",
+ 4 => "Apr",
+ 5 => "May",
+ 6 => "Jun",
+ 7 => "Jul",
+ 8 => "Aug",
+ 9 => "Sep",
+ 10 => "Oct",
+ 11 => "Nov",
+ 12 => "Dec",
+ _ => "Unk",
+ }
+}
+
lazy_static! {
static ref HIT_COUNTER: IntCounterVec =
register_int_counter_vec!(opts!("hits", "Number of hits to various pages"), &["page"])
@@ -43,7 +61,7 @@ lazy_static! {
"{dayname}, {day} {month} {year} {hour}:{minute}:{second} GMT",
dayname = weekday_to_name(now.weekday()),
day = now.day(),
- month = now.month(),
+ month = month_to_name(now.month()),
year = now.year(),
hour = now.hour(),
minute = now.minute(),