Use calendar days for /activity message history.

(imported from commit f4d331e8384ff2663fb6aab7170482f057d7403f)
This commit is contained in:
Steve Howell 2014-01-06 11:46:47 -05:00
parent 96ebf7e147
commit 26548da779
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ def get_realm_day_counts():
query = ''' query = '''
select select
r.domain, r.domain,
trunc(extract(epoch from now() - pub_date)/(24*3600)) age, (now()::date - pub_date::date) age,
count(*) cnt count(*) cnt
from zerver_message m from zerver_message m
join zerver_userprofile up on up.id = m.sender_id join zerver_userprofile up on up.id = m.sender_id
@ -53,7 +53,7 @@ def get_realm_day_counts():
where where
(not up.is_bot) (not up.is_bot)
and and
pub_date > now() - interval '8 day' pub_date > now()::date - interval '8 day'
and and
r.domain not in ('zulip.com', 'mit.edu') r.domain not in ('zulip.com', 'mit.edu')
group by group by