From 1d9eb3dc53b5148402568a65d1a72fd7fde536b0 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 11 Aug 2016 20:56:06 +0200 Subject: Correctly handle calls before the first tuesday --- update_topic.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'update_topic.py') diff --git a/update_topic.py b/update_topic.py index 741ad4e..e88c80a 100644 --- a/update_topic.py +++ b/update_topic.py @@ -92,7 +92,10 @@ def seconds_until(when): def get_next_meeting(): today = datetime.today() - return (today + relativedelta(months=+1, day=1, weekday=TUESDAY)).date() + delta = relativedelta(day=1, weekday=TUESDAY) + if today >= (today + delta): + delta.months = 1 + return (today + delta).date() def update_topic(phenny, channel, topic): -- cgit v1.2.3-1-g7c22