elapsed_t: ensure retro compatibility with the previous displaySeconds setting

pull/3472/head
paul-arg 2024-06-23 23:03:59 +02:00
parent 03f1f8cda0
commit e5c82c4341
2 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,15 @@ var settings = Object.assign({
time24: true
}, require('Storage').readJSON(APP_NAME + ".settings.json", true) || {});
function writeSettings() {
require('Storage').writeJSON(APP_NAME + ".settings.json", settings);
}
if (typeof settings.displaySeconds === 'boolean') {
settings.displaySeconds = 1;
writeSettings();
}
var data = Object.assign({
// default values
target: {

View File

@ -14,6 +14,11 @@
require('Storage').writeJSON(FILE, settings);
}
if (typeof settings.displaySeconds === 'boolean') {
settings.displaySeconds = 1;
writeSettings();
}
var dateFormats = ["DD/MM/YYYY", "MM/DD/YYYY", "YYYY-MM-DD"];
var displaySecondsFormats = ["Never", "Unlocked", "Always"];