From 3447acb1481a1530eb5958a1f4269529adb53b9c Mon Sep 17 00:00:00 2001 From: Phyks Date: Tue, 10 Sep 2013 21:55:59 +0200 Subject: [PATCH] Bug correction in date checking --- velib_stats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/velib_stats.py b/velib_stats.py index c98c50d..3cc81d0 100755 --- a/velib_stats.py +++ b/velib_stats.py @@ -39,8 +39,9 @@ if r.status == 200: if "Jour" in line: previous_day = line[7:] # If today != last day of update, add a header - if (previous_day[:2] != today.strftime('%d') and - previous_day[2:] != today.strftime('%m')): + previous_day = previous_day.split("/") + if (previous_day[0] != today.strftime('%d') and + previous_day[1] != today.strftime('%m')): write = ("Jour = "+today.strftime('%d/%m')+"\n" + "======================\n" + "Heure\t\tMin\t\tDispos\t\tPlaces\n" +