From 7b3901211a0165558eebca8fe7490ca79b09f97b Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Fri, 28 Dec 2018 18:34:41 +0100 Subject: [PATCH] moment.js: Set language on initialization closes #544 (Translation error german / english mix) --- resources/assets/js/moment-countdown.js | 2 ++ resources/assets/js/vendor.js | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/moment-countdown.js b/resources/assets/js/moment-countdown.js index f5effbc0..d12ee7ab 100644 --- a/resources/assets/js/moment-countdown.js +++ b/resources/assets/js/moment-countdown.js @@ -5,6 +5,8 @@ */ $(document).ready(function () { if (typeof moment !== 'undefined') { + moment.locale($('html').attr('lang')); + $.each($('.moment-countdown'), function (i, e) { var span = $(e); var text = span.html(); diff --git a/resources/assets/js/vendor.js b/resources/assets/js/vendor.js index d9da845c..1d61d42b 100644 --- a/resources/assets/js/vendor.js +++ b/resources/assets/js/vendor.js @@ -9,10 +9,6 @@ require('./forms'); require('./sticky-headers'); require('./moment-countdown'); -$(function () { - moment.locale($('html').attr('lang')); -}); - $.ajaxSetup({ headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')} });