aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-07 07:01:22 +0200
committerMattias Andrée <maandree@kth.se>2016-07-07 07:01:22 +0200
commita0e7cbe99523447212a03a6e78990c6df4a8a4f9 (patch)
treee3007cec6a9d22992f297a3f8b57a071eadd2b50
parentCommits got mixed up, this is: Fix error in days per months table (diff)
downloadblue-a0e7cbe99523447212a03a6e78990c6df4a8a4f9.tar.gz
blue-a0e7cbe99523447212a03a6e78990c6df4a8a4f9.tar.bz2
blue-a0e7cbe99523447212a03a6e78990c6df4a8a4f9.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rwxr-xr-xblue.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/blue.py b/blue.py
index 8cf5b66..436f2cb 100755
--- a/blue.py
+++ b/blue.py
@@ -219,6 +219,11 @@ else:
days = 29 if y % 400 == 0 or (y % 4 == 0 and not y % 100 == 0) else 28
days = [31, days, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
d = days[m - 1]
+ else:
+ days = 29 if y % 400 == 0 or (y % 4 == 0 and not y % 100 == 0) else 28
+ days = [31, days, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+ if d > days[m - 1]:
+ d = days[m - 1]
stop_date = (y, m, d)