moment.js: Set language on initialization

closes #544 (Translation error german / english mix)
This commit is contained in:
Igor Scheller 2018-12-28 18:34:41 +01:00
parent 97bab8e063
commit 7b3901211a
2 changed files with 2 additions and 4 deletions

View File

@ -5,6 +5,8 @@
*/ */
$(document).ready(function () { $(document).ready(function () {
if (typeof moment !== 'undefined') { if (typeof moment !== 'undefined') {
moment.locale($('html').attr('lang'));
$.each($('.moment-countdown'), function (i, e) { $.each($('.moment-countdown'), function (i, e) {
var span = $(e); var span = $(e);
var text = span.html(); var text = span.html();

View File

@ -9,10 +9,6 @@ require('./forms');
require('./sticky-headers'); require('./sticky-headers');
require('./moment-countdown'); require('./moment-countdown');
$(function () {
moment.locale($('html').attr('lang'));
});
$.ajaxSetup({ $.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')} headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
}); });