aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data/style.scss6
-rw-r--r--src/renderer.rs17
2 files changed, 7 insertions, 16 deletions
diff --git a/data/style.scss b/data/style.scss
index fb76a9a..c172ae8 100644
--- a/data/style.scss
+++ b/data/style.scss
@@ -267,7 +267,7 @@ table thead th.size {
}
table thead th.date {
- width: 15em;
+ width: 21em;
}
table tbody tr:nth-child(odd) {
@@ -295,10 +295,6 @@ td.date-cell {
justify-content: space-between;
}
-.at {
- color: var(--at_color);
-}
-
.history {
color: var(--date_text_color);
}
diff --git a/src/renderer.rs b/src/renderer.rs
index f53620f..d7b00ec 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -1,7 +1,7 @@
use std::time::SystemTime;
use actix_web::http::StatusCode;
-use chrono::{DateTime, Utc};
+use chrono::{DateTime, Local};
use chrono_humanize::Humanize;
use clap::{crate_name, crate_version, ValueEnum};
use fast_qr::{convert::svg::SvgBuilder, qr::QRCodeError, QRBuilder};
@@ -528,9 +528,7 @@ fn entry_row(
td.date-cell {
@if let Some(modification_date) = convert_to_utc(entry.last_modification_date) {
span {
- (modification_date.0) " "
- span.at { " at " }
- (modification_date.1) " "
+ (modification_date) " "
}
}
@if let Some(modification_timer) = humanize_systemtime(entry.last_modification_date) {
@@ -622,13 +620,10 @@ fn page_header(title: &str, file_upload: bool, favicon_route: &str, css_route: &
/// Converts a SystemTime object to a strings tuple (date, time)
/// Date is formatted as %e %b, e.g. Jul 12
/// Time is formatted as %R, e.g. 22:34
-fn convert_to_utc(src_time: Option<SystemTime>) -> Option<(String, String)> {
- src_time.map(DateTime::<Utc>::from).map(|date_time| {
- (
- date_time.format("%b %e").to_string(),
- date_time.format("%R").to_string(),
- )
- })
+fn convert_to_utc(src_time: Option<SystemTime>) -> Option<String> {
+ src_time
+ .map(DateTime::<Local>::from)
+ .map(|date_time| date_time.format("%Y/%m/%d %H:%M:%S %:z").to_string())
}
/// Converts a SystemTime to a string readable by a human,