diff --git a/ReactNativeClient/lib/BaseApplication.js b/ReactNativeClient/lib/BaseApplication.js index d5de6967253..1c3731c73d2 100644 --- a/ReactNativeClient/lib/BaseApplication.js +++ b/ReactNativeClient/lib/BaseApplication.js @@ -391,7 +391,8 @@ class BaseApplication { // }); // } - if ((action.type == 'SETTING_UPDATE_ONE' && (action.key == 'dateFormat' || action.key == 'timeFormat')) || action.type == 'SETTING_UPDATE_ALL') { + if ((action.type == 'SETTING_UPDATE_ONE' && (action.key == 'dateFormat' || action.key == 'timeFormat' || action.key == 'locale')) || action.type == 'SETTING_UPDATE_ALL') { + time.setLocale(Setting.value('locale')); time.setDateFormat(Setting.value('dateFormat')); time.setTimeFormat(Setting.value('timeFormat')); } diff --git a/ReactNativeClient/lib/time-utils.js b/ReactNativeClient/lib/time-utils.js index ee13a55a31f..3613bde056c 100644 --- a/ReactNativeClient/lib/time-utils.js +++ b/ReactNativeClient/lib/time-utils.js @@ -4,6 +4,16 @@ class Time { constructor() { this.dateFormat_ = 'DD/MM/YYYY'; this.timeFormat_ = 'HH:mm'; + this.locale_ = 'en-us'; + } + + locale() { + return this.locale_; + } + + setLocale(v) { + moment.locale(v); + this.locale_ = v } dateFormat() {