diff --git a/analytics/views.py b/analytics/views.py index 9f305dfc79..937956a84d 100644 --- a/analytics/views.py +++ b/analytics/views.py @@ -287,6 +287,8 @@ def get_realm_day_counts() -> Dict[str, Dict[str, str]]: return result def realm_summary_table(realm_minutes: Dict[str, float]) -> str: + now = timezone_now() + query = ''' SELECT realm.string_id, @@ -397,7 +399,7 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str: for row in rows: row['date_created_day'] = row['date_created'].strftime('%Y-%m-%d') - row['age_days'] = int((timezone_now() - row['date_created']).total_seconds() + row['age_days'] = int((now - row['date_created']).total_seconds() / 86400) row['is_new'] = row['age_days'] < 12 * 7 @@ -455,7 +457,8 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str: content = loader.render_to_string( 'analytics/realm_summary_table.html', - dict(rows=rows, num_active_sites=num_active_sites) + dict(rows=rows, num_active_sites=num_active_sites, + now=now.strftime('%Y-%m-%dT%H:%M:%SZ')) ) return content diff --git a/templates/analytics/realm_summary_table.html b/templates/analytics/realm_summary_table.html index c638e84ad3..28a7323772 100644 --- a/templates/analytics/realm_summary_table.html +++ b/templates/analytics/realm_summary_table.html @@ -1,5 +1,13 @@

{{ num_active_sites }} active sites

+

+

+ +