Browse Source

Show year in end time if not this year.

tags/v0.2
Ben Kurtovic 9 years ago
parent
commit
44da856120
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      earwigbot/commands/remind.py

+ 5
- 1
earwigbot/commands/remind.py View File

@@ -402,7 +402,11 @@ class _Reminder(object):
def end_time(self): def end_time(self):
"""Return a string representing the end time of a reminder.""" """Return a string representing the end time of a reminder."""
if self.end >= time.time(): if self.end >= time.time():
ends = time.strftime("%b %d %H:%M:%S %Z", time.localtime(self.end))
lctime = time.localtime(self.end)
if lctime.tm_year == time.localtime().tm_year:
ends = time.strftime("%b %d %H:%M:%S %Z", lctime)
else:
ends = time.strftime("%b %d, %Y %H:%M:%S %Z", lctime)
return "ends {0}".format(ends) return "ends {0}".format(ends)
return "expired" return "expired"




Loading…
Cancel
Save