##// END OF EJS Templates
Use timezone when getting PPD
neko259 -
r412:1f91c9e9 default
parent child Browse files
Show More
@@ -174,8 +174,10 b' class PostManager(models.Manager):'
174 for i in POSTS_PER_DAY_RANGE:
174 for i in POSTS_PER_DAY_RANGE:
175 day_end = today + timedelta(i - 1)
175 day_end = today + timedelta(i - 1)
176 day_start = today + timedelta(i - 2)
176 day_start = today + timedelta(i - 2)
177 day_time_start = datetime.combine(day_start, dtime())
177 day_time_start = timezone.make_aware(datetime.combine(day_start,
178 day_time_end = datetime.combine(day_end, dtime())
178 dtime()), timezone.get_current_timezone())
179 day_time_end = timezone.make_aware(datetime.combine(day_end,
180 dtime()), timezone.get_current_timezone())
179
181
180 posts_per_days.append(float(self.filter(
182 posts_per_days.append(float(self.filter(
181 pub_time__lte=day_time_end,
183 pub_time__lte=day_time_end,
General Comments 0
You need to be logged in to leave comments. Login now