1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Added option to set date and time format

This commit is contained in:
Laurent Cozic
2017-11-28 18:02:54 +00:00
parent 6e23fead59
commit f9f5974267
6 changed files with 80 additions and 16 deletions

View File

@ -7,6 +7,7 @@ const AlarmServiceDriver = require('lib/services/AlarmServiceDriver');
const { createStore, applyMiddleware } = require('redux');
const { shimInit } = require('lib/shim-init-react.js');
const { Log } = require('lib/log.js');
const { time } = require('lib/time-utils.js');
const { AppNav } = require('lib/components/app-nav.js');
const { Logger } = require('lib/logger.js');
const { Note } = require('lib/models/note.js');
@ -63,6 +64,11 @@ const generalMiddleware = store => next => async (action) => {
reg.setupRecurrentSync();
}
if ((action.type == 'SETTING_UPDATE_ONE' && (action.key == 'dateFormat' || action.key == 'timeFormat')) || (action.type == 'SETTING_UPDATE_ALL')) {
time.setDateFormat(Setting.value('dateFormat'));
time.setTimeFormat(Setting.value('timeFormat'));
}
if (action.type == 'SETTING_UPDATE_ONE' && action.key == 'locale' || action.type == 'SETTING_UPDATE_ALL') {
setLocale(Setting.value('locale'));
}