From bbbfd4aef52416a98becb2b512b4a92a94f60453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Tue, 23 Aug 2016 04:46:28 +0200 Subject: [PATCH] Moment.js sur les dates d'annulation K-Psul --- kfet/templates/kfet/kpsul.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index 4e85eaf0..4007b286 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -987,11 +987,11 @@ $(document).ready(function() { if (ope['canceled_at']) { ope_html.addClass('canceled'); - if (ope['canceled_by__trigramme']) { - var cancel = 'Annulé par '+ope['canceled_by__trigramme']+' le '+ope['canceled_at']; - } else { - var cancel = 'Annulé le '+ope['canceled_at']; - } + var cancel = 'Annulé'; + if (ope['canceled_by__trigramme']) + cancel += ' par '+ope['canceled_by__trigramme']; + var canceled_at = moment.tz(ope['canceled_at'],'UTC'); + cancel += ' le '+canceled_at.tz('Europe/Paris').format('DD/MM/YY à HH:mm:ss'); ope_html.find('.canceled').text(cancel); } @@ -1182,11 +1182,11 @@ $(document).ready(function() { function cancelOpe(ope) { var ope_html = history_container.find('[data-ope='+ope['id']+']'); ope_html.addClass('canceled'); - if (ope['canceled_by__trigramme']) { - var cancel = 'Annulé par '+ope['canceled_by__trigramme']+' le '+ope['canceled_at']; - } else { - var cancel = 'Annulé le '+ope['canceled_at']; - } + var cancel = 'Annulé'; + if (ope['canceled_by__trigramme']) + cancel += ' par '+ope['canceled_by__trigramme']; + var canceled_at = moment.tz(ope['canceled_at'], 'UTC'); + cancel += ' le '+canceled_at.tz('Europe/Paris').format('DD/MM/YY à HH:mm:ss'); ope_html.find('.canceled').text(cancel); }