Skip to content
Snippets Groups Projects
Commit d100db52 authored by Xaver Maierhofer's avatar Xaver Maierhofer Committed by Geno
Browse files

[TASK] Replace deprecated moment.js function

parent f2659010
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,8 @@ define(['polyglot', 'moment', 'helper'], function (Polyglot, moment, helper) {
function setTranslation(json) {
_.extend(json);
moment.locale(_.locale(), {
if (moment.locale(_.locale()) !== _.locale()) {
moment.defineLocale(_.locale(), {
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
......@@ -48,6 +49,7 @@ define(['polyglot', 'moment', 'helper'], function (Polyglot, moment, helper) {
relativeTime: json.momentjs.relativeTime
});
}
}
window._ = new Polyglot({ locale: getLocale(), allowMissing: true });
helper.getJSON('locale/' + _.locale() + '.json?' + config.cacheBreaker).then(setTranslation);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment