1
0
Fork 0

clkinfocal switch on the string of the date format

master
Hugh Barney 2023-11-11 18:42:08 +00:00
parent e9ec30ddf0
commit 1f7f4fdbf1
2 changed files with 3 additions and 5 deletions

View File

@ -2,14 +2,13 @@
require("Font4x8Numeric").add(Graphics); require("Font4x8Numeric").add(Graphics);
var settings = require("Storage").readJSON("clkinfocal.json",1)||{}; var settings = require("Storage").readJSON("clkinfocal.json",1)||{};
settings.fmt = settings.fmt||0; settings.fmt = settings.fmt||"DDD";
var getDateString = function(dt) { var getDateString = function(dt) {
var fmt = 1; // get from settings
switch(settings.fmt) { switch(settings.fmt) {
case 2: // dd MMM case "dd MMM":
return '' + dt.getDate() + ' ' + require("locale").month(dt,1).toUpperCase(); return '' + dt.getDate() + ' ' + require("locale").month(dt,1).toUpperCase();
case 1: // DDD dd case "DDD dd":
return require("locale").dow(dt,1).toUpperCase() + ' ' + dt.getDate(); return require("locale").dow(dt,1).toUpperCase() + ' ' + dt.getDate();
default: // DDD default: // DDD
return require("locale").dow(dt,1).toUpperCase(); return require("locale").dow(dt,1).toUpperCase();

View File

@ -10,7 +10,6 @@
"storage": [ "storage": [
{"name":"clkinfocal.clkinfo.js","url":"clkinfo.js"}, {"name":"clkinfocal.clkinfo.js","url":"clkinfo.js"},
{"name":"clkinfocal.settings.js","url":"settings.js"} {"name":"clkinfocal.settings.js","url":"settings.js"}
], ],
"data": [{"name":"clkinfocal.json"}] "data": [{"name":"clkinfocal.json"}]
} }