From dcfc220feb0821d66f9b31b5c9b2fb477cd40120 Mon Sep 17 00:00:00 2001 From: IvkinStanislav <76910130+IvkinStanislav@users.noreply.github.com> Date: Thu, 10 Nov 2022 23:40:33 +0300 Subject: Refactoring --- src/renderer.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/renderer.rs') diff --git a/src/renderer.rs b/src/renderer.rs index 0577b80..e4c8fcd 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -526,7 +526,7 @@ fn entry_row( } } td.date-cell { - @if let Some(modification_date) = convert_to_utc(entry.last_modification_date) { + @if let Some(modification_date) = convert_to_local(entry.last_modification_date) { span { (modification_date) " " } @@ -618,9 +618,7 @@ 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) -> Option { +fn convert_to_local(src_time: Option) -> Option { src_time .map(DateTime::::from) .map(|date_time| date_time.format("%Y-%m-%d %H:%M:%S %:z").to_string()) -- cgit v1.2.3