Exemplo n.º 1
0
    def update_weeks(self):
        service = DayService(self.__user)
        tz = service.get_current_timezone()
        now = timezone.now().astimezone(tz)
        start_date = self.__user.date_joined.astimezone(tz)

        week = self.get_or_create_week(start_date)
        while week.end < now:
            next_day = week.end + timedelta(days=1)
            week = self.get_or_create_week(next_day)
Exemplo n.º 2
0
 def timezone(self):
     service = DayService(user=self.user)
     return service.get_current_timezone()
Exemplo n.º 3
0
 def __localize_datetime(self, time):
     service = DayService(user=self.user)
     tz = service.get_current_timezone()
     return tz.localize(time)