From 8f292bd22ce7407190bb63214e404eb7082c7f39 Mon Sep 17 00:00:00 2001 From: Vinicius Munhoz Date: Sat, 12 Oct 2019 23:04:51 -0300 Subject: [PATCH] fix day counting to not include today --- wordtrack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wordtrack.py b/wordtrack.py index b0622fb..23e0f6e 100755 --- a/wordtrack.py +++ b/wordtrack.py @@ -386,7 +386,7 @@ def wordtrack_start(filename=DEFAULT_FILE, days=DEFAULT_TIME_PERIOD, wordgoal=DE Create a new wordcount record (this stops previous count) """ startdate = datetime.date.today() - enddate = startdate + datetime.timedelta(days) + enddate = startdate + datetime.timedelta(days-1) tracks = _read_wordtrack_file(filename) # create the new record and save it tracks.append([startdate, enddate, wordgoal, 0])