mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 04:12:02 +00:00
activity: Display times in US/Eastern.
(imported from commit 730d37e0b8da046c1fe9e0c0cfc9b420da560865)
This commit is contained in:
@@ -10,6 +10,8 @@ from zerver.lib.timestamp import timestamp_to_datetime
|
|||||||
import datetime
|
import datetime
|
||||||
import itertools
|
import itertools
|
||||||
import time
|
import time
|
||||||
|
import pytz
|
||||||
|
eastern_tz = pytz.timezone('US/Eastern')
|
||||||
|
|
||||||
def make_table(title, cols, rows):
|
def make_table(title, cols, rows):
|
||||||
data = dict(title=title, cols=cols, rows=rows)
|
data = dict(title=title, cols=cols, rows=rows)
|
||||||
@@ -581,7 +583,7 @@ def get_user_activity_summary(records):
|
|||||||
|
|
||||||
def format_date_for_activity_reports(date):
|
def format_date_for_activity_reports(date):
|
||||||
if date:
|
if date:
|
||||||
return date.strftime('%Y-%m-%d %H:%M')
|
return date.astimezone(eastern_tz).strftime('%Y-%m-%d %H:%M')
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
@@ -667,7 +669,7 @@ def realm_user_summary_table(all_records):
|
|||||||
|
|
||||||
def get_last_visit(user_summary, k):
|
def get_last_visit(user_summary, k):
|
||||||
if k in user_summary:
|
if k in user_summary:
|
||||||
return user_summary[k]['last_visit'].strftime('%Y-%m-%d %H:%M')
|
return user_summary[k]['last_visit'].astimezone(eastern_tz).strftime('%Y-%m-%d %H:%M')
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user