fin_connexion: fix date fin du mois sur calendrier

This commit is contained in:
Daniel STAN 2014-10-24 12:26:25 +02:00
parent 28e44fc6fa
commit b747a51aac

View file

@ -128,8 +128,10 @@ def prev(c, date):
year = date.year year = date.year
cal = calendar.Calendar() cal = calendar.Calendar()
first = datetime.datetime(day=1, month=month, year=year, tzinfo=pytz.UTC) first = datetime.datetime(day=1, month=month, year=year, tzinfo=pytz.UTC)
last = first + 31*DAY # un peu plus probablement last = first.replace(month=1+month%12, year=year+int(month==12))
disconnect = brief(c, first, last) disconnect = brief(c, first, last)
by_day = {x: 0 for x in xrange(1,32)} by_day = {x: 0 for x in xrange(1,32)}
for adh in disconnect: for adh in disconnect:
@ -156,7 +158,8 @@ def prev(c, date):
# zone de test # zone de test
warn(c.search(u'aid=4281')[0], 7) #warn(c.search(u'aid=4281')[0], 7)
prev(c, today)
# Plusieurs type d'execution: # Plusieurs type d'execution:
# * Manuel (préventif): avertit d'une déco dans moins d'un mois # * Manuel (préventif): avertit d'une déco dans moins d'un mois