Moment settings based on users locale

This commit is contained in:
okbel
2018-01-05 07:34:17 -03:00
parent e83f99e389
commit 88b44c3bf6
+4
View File
@@ -3,6 +3,7 @@ import has from 'lodash/has';
import get from 'lodash/get';
import merge from 'lodash/merge';
import moment from 'moment';
import 'moment/locale/da';
import 'moment/locale/es';
import 'moment/locale/fr';
@@ -45,6 +46,9 @@ function init() {
const locale = getLocale();
setLocale(locale);
// Setting moment
moment.locale(locale);
// Extract language key.
lang = locale.split('-')[0];