From 3f4011f7c4ca3d7f23b7454caec0e86bb3a10f4d Mon Sep 17 00:00:00 2001 From: Krateng Date: Tue, 9 Apr 2019 13:49:28 +0200 Subject: [PATCH] Fixed bug in ranges calculation --- malojatime.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/malojatime.py b/malojatime.py index ea98a76..c8ea5f3 100644 --- a/malojatime.py +++ b/malojatime.py @@ -71,7 +71,7 @@ def time_fix(t): except: pass - if t[1].startswith("W"): + if isinstance(t[1],str) and t[1].startswith("W"): try: weeknum = int(t[1][1:]) return [t[0],"W",t[1]] @@ -252,7 +252,7 @@ def time_stamps(since=None,to=None,within=None): stamp2 = int(datetime.datetime(date[0],date[1],date[2],tzinfo=datetime.timezone.utc).timestamp()) - return (stamp1,stamp2) + return (stamp1,stamp2-1)