"day" vs "days" in brithday.py

This commit is contained in:
jesopo 2019-11-28 14:23:33 +00:00
parent c79bd6d0ba
commit 746f08b5a8

View file

@ -70,15 +70,16 @@ class Module(ModuleManager.BaseModule):
if next_birthday < now: if next_birthday < now:
next_birthday = next_birthday.replace(year=next_birthday.year+1) next_birthday = next_birthday.replace(year=next_birthday.year+1)
days = (next_birthday-now).days days = (next_birthday-now).days
days_str = "day" if days == 1 else "days"
age = next_birthday.year-birthday_parsed.year age = next_birthday.year-birthday_parsed.year
if days > 0: if days > 0:
if years: if years:
event["stdout"].write("%s is %d in %d days" % ( event["stdout"].write("%s is %d in %d %s" % (
target_user.nickname, age, days)) target_user.nickname, age, days, days_str))
else: else:
event["stdout"].write("%s birthday is in %d days" % ( event["stdout"].write("%s birthday is in %d %s" % (
_apostrophe(target_user.nickname), days)) _apostrophe(target_user.nickname), days, days_str))
else: else:
if years: if years:
event["stdout"].write("%s is %d today! 🎉" % ( event["stdout"].write("%s is %d today! 🎉" % (