From a0c3a276ec4870b083bec829fcafab222ba51e68 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 19 Jan 2019 19:33:36 -0800 Subject: [PATCH] Fix bug in HistoryItem.get_finished_label_text --- onionshare_gui/mode/history.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/mode/history.py b/onionshare_gui/mode/history.py index 44ee293f..bb419ec7 100644 --- a/onionshare_gui/mode/history.py +++ b/onionshare_gui/mode/history.py @@ -40,12 +40,11 @@ class HistoryItem(QtWidgets.QWidget): def cancel(self): pass - def get_finished_label_text(self, started_ts): + def get_finished_label_text(self, started): """ When an item finishes, returns a string displaying the start/end datetime range. started is a datetime object. """ - started = datetime.fromtimestamp(started_ts) ended = datetime.now() if started.year == ended.year and started.month == ended.month and started.day == ended.day: if started.hour == ended.hour and started.minute == ended.minute: @@ -111,7 +110,7 @@ class ShareHistoryItem(HistoryItem): self.common.format_seconds(time.time() - self.started)) # Change the label - self.label.setText(self.get_finished_label_text(self.started)) + self.label.setText(self.get_finished_label_text(self.started_dt)) else: elapsed = time.time() - self.started