1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-05 15:57:23 +01:00

convert the backup increment time to the local timezone, fixes #700

Duplicity gives times in UTC. We were assuming times were in local time.
This commit is contained in:
Joshua Tauberer
2016-02-05 08:46:21 -05:00
parent f5c376dca8
commit 178527dab1
3 changed files with 4 additions and 4 deletions

View File

@@ -42,10 +42,10 @@ def backup_status(env):
# Get duplicity collection status and parse for a list of backups.
def parse_line(line):
keys = line.strip().split()
date = dateutil.parser.parse(keys[1])
date = dateutil.parser.parse(keys[1]).astimezone(dateutil.tz.tzlocal())
return {
"date": keys[1],
"date_str": date.strftime("%x %X"),
"date_str": date.strftime("%x %X") + " " + now.tzname(),
"date_delta": reldate(date, now, "the future?"),
"full": keys[0] == "full",
"size": 0, # collection-status doesn't give us the size
@@ -120,7 +120,6 @@ def backup_status(env):
bak["deleted_in"] = deleted_in
return {
"tz": now.tzname(),
"backups": backups,
}

View File

@@ -142,7 +142,7 @@ function show_system_backup() {
var b = r.backups[i];
var tr = $('<tr/>');
if (b.full) tr.addClass("full-backup");
tr.append( $('<td/>').text(b.date_str + " " + r.tz) );
tr.append( $('<td/>').text(b.date_str) );
tr.append( $('<td/>').text(b.date_delta + " ago") );
tr.append( $('<td/>').text(b.full ? "full" : "increment") );
tr.append( $('<td style="text-align: right"/>').text( nice_size(b.size)) );