weihnachten hinzugefügt
This commit is contained in:
parent
64afd24a90
commit
680066dfa9
|
@ -52,5 +52,23 @@ class Holidays(callbacks.Plugin):
|
|||
else:
|
||||
irc.reply(f'Es sind noch {days_remaining} Tage bis Ostersonntag.')
|
||||
ostern = wrap(ostern)
|
||||
|
||||
|
||||
@internationalizeDocstring
|
||||
def weihnachten(self, irc, msg, args):
|
||||
"""
|
||||
Returns the number of days until christmas
|
||||
"""
|
||||
# Determine left days in this year
|
||||
christmas_current_year = date(date.today().year, 12, 25)
|
||||
days_remaining = (christmas_current_year - date.today()).days
|
||||
# If it has already passed, determine date for next year
|
||||
if days_remaining < 0:
|
||||
christmas_next_year = date(date.today().year+1, 12, 25)
|
||||
days_remaining = (christmas_next_year - date.today()).days
|
||||
|
||||
if days_remaining == 0:
|
||||
irc.reply('Heute ist der 1. Weichnachtstag.')
|
||||
else:
|
||||
irc.reply(f'Es sind noch {days_remaining} Tage bis zum 1. Weihnachtstag.')
|
||||
weihnachten = wrap(weihnachten)
|
||||
Class = Holidays
|
||||
|
|
Loading…
Reference in New Issue