Skip to content

Commit

Permalink
date formatting edited (-d replaced)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindakladivova committed May 24, 2024
1 parent f4d8c62 commit 40b44ae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gui/wxpython/history/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,17 @@ def dayToLabel(self, day):
if day == OLD_DATE:
return _("No time info")

month_name = day.strftime("%B")
if day == current_date:
return "{:%B %-d} (today)".format(day)
return "{0} {1} (today)".format(month_name, day.day)
elif day == current_date - datetime.timedelta(days=1):
return "{:%B %-d} (yesterday)".format(day)
return "{0} {1} (yesterday)".format(month_name, day.day)
elif day >= (current_date - datetime.timedelta(days=current_date.weekday())):
return "{:%B %-d} (this week)".format(day)
return "{0} {1} (this week)".format(month_name, day.day)
elif day.year == current_date.year:
return "{:%B %-d}".format(day)
return "{0} {1}".format(month_name, day.day)
else:
return "{:%B %-d, %Y}".format(day)
return "{0} {1}, {2}".format(month_name, day.day, day.year)


class HistoryBrowserTree(CTreeView):
Expand Down

0 comments on commit 40b44ae

Please sign in to comment.