From 339e20d0b7b2ca83a118964a08a86a0431e34420 Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 21 Jun 2017 13:24:38 -0500 Subject: [PATCH] changd date format on orders view --- hosting/templates/hosting/order_detail.html | 15 ++++++++++++++- hosting/templates/hosting/orders.html | 2 +- hosting/templates/hosting/user_keys.html | 2 -- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 1eec7f99..c212d248 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -35,7 +35,7 @@
{% trans "Billed To:"%}
- {{order.created_at}}

+ {{order.created_at}}

{% trans "Status:"%}
+ + window.onload = function () { + var locale_date = new Date(document.getElementById("order-created_at").textContent + ' UTC'); + locale_date = moment(locale_date).format("YYYY-MM-DD h:mm:ss a"); + document.getElementById('order-created_at').innerHTML = locale_date; + + }; + + {%endblock%} + diff --git a/hosting/templates/hosting/orders.html b/hosting/templates/hosting/orders.html index b52e7fc0..99aab23e 100644 --- a/hosting/templates/hosting/orders.html +++ b/hosting/templates/hosting/orders.html @@ -24,7 +24,7 @@ {% for order in orders %} {{ order.id }} - {{ order.created_at }} + {{ order.created_at | date:"M d, Y" }} {{ order.price }} CHF {% if order.approved %} {% trans "Approved"%} diff --git a/hosting/templates/hosting/user_keys.html b/hosting/templates/hosting/user_keys.html index a4a0c2cf..571d423a 100644 --- a/hosting/templates/hosting/user_keys.html +++ b/hosting/templates/hosting/user_keys.html @@ -95,11 +95,9 @@