Browse Source

weihnachten hinzugefügt

master
Christian Pütter 7 months ago
parent
commit
680066dfa9
1 changed files with 19 additions and 1 deletions
  1. +19
    -1
      Holidays/plugin.py

+ 19
- 1
Holidays/plugin.py View File

@ -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…
Cancel
Save