{% extends "translator/base.html" %}
{% block body %}
<h1>Failing applications</h1>
{% if failing_apps %}
<table class="table table-bordered table-hover">
    <thead>
        <tr>
            <th colspan="2">Name</th>
            <th>URL</th>
            <th>Since</th>
        </tr>
    </thead>
    <tbody>
        {% for app in failing_apps %}
        <tr>
            <td><img src="{{ app.app_thumb }}" width="50px"></td>
            <td><a href="{{ app.app_link }}">{{ app.name }}</a></td>
            <td><a href="{{ app.url }}">{{ app.url[:70] }}{% if app.url|length > 70 %}...{% endif %}</a></td>
            <td>{{ app.failing_since }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% else %}
    <p>There are no failing apps. Let's celebrate it!</p>
{% endif %}
{% endblock %}

{% extends "translator/base.html" %}
{% block body %}
<h1>Failing applications</h1>
{% if failing_apps %}
<table class="table table-bordered table-hover">
    <thead>
        <tr>
            <th colspan="2">Name</th>
            <th>URL</th>
            <th>Since</th>
        </tr>
    </thead>
    <tbody>
        {% set FORMAT = '%Y-%m-%d %H:%M:%SZ' %}
        {% for app in failing_apps %}
        <tr>
            <td><img src="{{ app.app_thumb }}" width="50px"></td>
            <td><a href="{{ app.app_link }}">{{ app.name }}</a></td>
            <td><a href="{{ app.url }}">{{ app.url[:70] }}{% if app.url|length > 70 %}...{% endif %}</a></td>
            <td><span data-date="{{ app.failing_since.strftime(FORMAT) }}"></span></td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% else %}
    <p>There are no failing apps. Let's celebrate it!</p>
{% endif %}
{% endblock %}

{% block tail %}
    <script>
        function zfill(n) {
            if (n < 10) 
                return "0" + n;
            return n;
        }

        $("span[data-date]").each(function (pos, value) {
            var datestring = $(value).data("date");
            var d = new Date(datestring.replace(/ /, 'T'));
            $(value).text(d.getFullYear() + "-" + zfill(d.getMonth() + 1) + "-" + zfill(d.getDate()) + " " + zfill(d.getHours()) + ":" + zfill(d.getMinutes()) + ":" + zfill(d.getSeconds()));
        });
    </script>

{% endblock %}

Use UTC when showing the failing apps date
Use UTC when showing the failing apps date
