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:
parent
415e7b84da
commit
d28fbe2d3b
@ -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'));
|
||||
}
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user