mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit 87b2adb50effc54ca02ea2b90e21bb880638fa3d
parent 85efbc65c45e287454f0d3eb831984ab378f2e50
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Fri, 23 Jul 2021 00:08:26 +0200

calculate timezone offset correctly

The timezone offset was being calculated in the wrong direction.
This made the timestamps printed differ from those outputted by
e.g. git log.

Diffstat:
Msrc/filters.rs | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/filters.rs b/src/filters.rs @@ -3,7 +3,7 @@ use git2::{Commit, Repository, Signature, Time}; pub fn format_datetime(time: &Time, format: &str) -> askama::Result<String> { use chrono::{FixedOffset, TimeZone}; - let offset = FixedOffset::west(time.offset_minutes() * 60); + let offset = FixedOffset::east(time.offset_minutes() * 60); let datetime = offset.timestamp(time.seconds(), 0); Ok(datetime.format(format).to_string()) }