1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-26 18:58:21 +02:00

Desktop: Apply current locale to date and time (#1822)

This commit is contained in:
Caleb John 2019-08-29 10:38:24 -06:00 committed by Laurent Cozic
parent 415e7b84da
commit d28fbe2d3b
2 changed files with 12 additions and 1 deletions

View File

@ -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'));
}

View File

@ -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() {