diff options
| author | Xe Iaso <me@christine.website> | 2022-07-04 14:44:09 +0000 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-07-04 14:44:09 +0000 |
| commit | 5d7daf179ee80f9f2be5345164a419fab051a651 (patch) | |
| tree | dfdddec82a768c8b472d9ed078258e0225aeea22 /src | |
| parent | 6be8b24dd293e3d48eafc37cecf1d98971be81f8 (diff) | |
| download | xesite-5d7daf179ee80f9f2be5345164a419fab051a651.tar.xz xesite-5d7daf179ee80f9f2be5345164a419fab051a651.zip | |
handlers: fix LAST_MODIFIED date format
Closes #463
Signed-off-by: Xe <me@christine.website>
Diffstat (limited to 'src')
| -rw-r--r-- | src/handlers/mod.rs | 20 |
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(), |
