Skip to content
Snippets Groups Projects
Commit b3ae7436 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Make static methods of the TimeSlotManager timezone aware

parent f12e5947
No related branches found
No related tags found
No related merge requests found
......@@ -1021,14 +1021,14 @@ class TimeSlotManager(models.Manager):
@staticmethod
def get_24h_timeslots(start):
end = start + timedelta(hours=24)
end = timezone.make_aware(start + timedelta(hours=24))
return TimeSlot.objects.filter(Q(start__lte=start, end__gte=start) |
Q(start__gt=start, start__lt=end)).exclude(end=start)
@staticmethod
def get_7d_timeslots(start):
start = datetime.combine(start, time(0, 0))
start = timezone.make_aware(datetime.combine(start, time(0, 0)))
end = start + timedelta(days=7)
return TimeSlot.objects.filter(Q(start__lte=start, end__gte=start) |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment