fin_connexion: le calendrier est calculé en UTC
This commit is contained in:
parent
fbc9a4ef5c
commit
dfa75aee76
1 changed files with 4 additions and 0 deletions
|
@ -137,6 +137,10 @@ def prev_calendar(c, date):
|
||||||
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:
|
||||||
date = compute_fin_connexion(adh)
|
date = compute_fin_connexion(adh)
|
||||||
|
# On veut le .day, mais dans le fuseau UTC (utilisé pour le select juste
|
||||||
|
# avant). Avec UTC, c'est facile: il suffit de virer l'offset de la TZ
|
||||||
|
if date.tzinfo:
|
||||||
|
date -= date.tzinfo.utcoffset(date)
|
||||||
by_day[date.day] += 1
|
by_day[date.day] += 1
|
||||||
|
|
||||||
yield ['L', 'M', 'Me', 'J', 'V', 'S', 'D']
|
yield ['L', 'M', 'Me', 'J', 'V', 'S', 'D']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue