mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Fix bug in HistoryItem.get_finished_label_text
This commit is contained in:
parent
862a0dc067
commit
a0c3a276ec
@ -40,12 +40,11 @@ class HistoryItem(QtWidgets.QWidget):
|
|||||||
def cancel(self):
|
def cancel(self):
|
||||||
pass
|
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.
|
When an item finishes, returns a string displaying the start/end datetime range.
|
||||||
started is a datetime object.
|
started is a datetime object.
|
||||||
"""
|
"""
|
||||||
started = datetime.fromtimestamp(started_ts)
|
|
||||||
ended = datetime.now()
|
ended = datetime.now()
|
||||||
if started.year == ended.year and started.month == ended.month and started.day == ended.day:
|
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:
|
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))
|
self.common.format_seconds(time.time() - self.started))
|
||||||
|
|
||||||
# Change the label
|
# 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:
|
else:
|
||||||
elapsed = time.time() - self.started
|
elapsed = time.time() - self.started
|
||||||
|
Loading…
Reference in New Issue
Block a user