activity: Show server time rather than browser time.

This gets rid of an inline <script> that was blocking #16451.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-10-08 16:42:10 -07:00 committed by Anders Kaseorg
parent 264bf1fc2a
commit f0ae2a88f2
2 changed files with 2 additions and 8 deletions

View File

@ -738,7 +738,7 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
content = loader.render_to_string( content = loader.render_to_string(
'analytics/realm_summary_table.html', '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')), utctime=now.strftime('%Y-%m-%d %H:%MZ')),
) )
return content return content

View File

@ -1,12 +1,6 @@
<h2 style="text-align: center;">{{ num_active_sites }} active sites</h2> <h2 style="text-align: center;">{{ num_active_sites }} active sites</h2>
<p id="utctime" style="text-align: center;"></p> <p style="text-align: center;">{{ utctime }}</p>
<p id="localtime" style="text-align: center;"></p>
<script>
var now = moment('{{ now }}');
$('#utctime')[0].innerHTML = moment.utc(now).format('YYYY-MM-DD HH:mm') + 'Z';
$('#localtime')[0].innerHTML = '(' + now.format('YYYY-MM-DD HH:mm ZZ') + ')';
</script>
<ul> <ul>
<li><strong>active (site)</strong> - has ≥5 DAUs</li> <li><strong>active (site)</strong> - has ≥5 DAUs</li>