la K-Fêt se réveille à 7h

This commit is contained in:
Qwann 2017-02-15 14:44:58 +01:00
parent 1c90608f6d
commit 46f343b1ab

View file

@ -2,6 +2,7 @@
from django.utils import timezone
from django.db.models import Sum
KFET_WAKES_UP_AT = 7
# donne le nom des jours d'une liste de dates
# dans un dico ordonné
@ -61,7 +62,8 @@ def lastmonths(nb):
year = this_year + (nb - i) // 12
first_days[i] = timezone.datetime(year=year,
month=month,
day=1)
day=1,
hour=KFET_WAKES_UP_AT)
return first_days
@ -69,7 +71,8 @@ def this_first_month_day():
now = timezone.now()
first_day = timezone.datetime(year=now.year,
month=now.month,
day=1)
day=1,
hour=KFET_WAKES_UP_AT)
return first_day
@ -78,7 +81,8 @@ def this_monday_morning():
monday = now - timezone.timedelta(days=now.isoweekday()-1)
monday_morning = timezone.datetime(year=monday.year,
month=monday.month,
day=monday.day)
day=monday.day,
hour=KFET_WAKES_UP_AT)
return monday_morning
@ -86,7 +90,8 @@ def this_morning():
now = timezone.now()
morning = timezone.datetime(year=now.year,
month=now.month,
day=now.day)
day=now.day,
hour=KFET_WAKES_UP_AT)
return morning