calendar: cleanup

master
Erik Andresen 2023-10-20 07:02:35 +02:00
parent 4fcd9dba40
commit 7a6aa80f30
2 changed files with 2 additions and 9 deletions

View File

@ -236,7 +236,6 @@ const drawCalendar = function(date) {
const eventsThisDay = eventsThisMonthPerDay[curDay.getDate()]; const eventsThisDay = eventsThisMonthPerDay[curDay.getDate()];
if (eventsThisDay && eventsThisDay.length > 0) { if (eventsThisDay && eventsThisDay.length > 0) {
eventsThisDay.sort((a,b) => a.date - b.date);
// Display events for this day // Display events for this day
eventsThisDay.forEach((ev, idx) => { eventsThisDay.forEach((ev, idx) => {
if (sameDay(ev.date, curDay)) { if (sameDay(ev.date, curDay)) {

View File

@ -1,13 +1,7 @@
(function (back) { (function (back) {
var FILE = "calendar.json"; const FILE = "calendar.json";
const HOLIDAY_FILE = "calendar.days.json"; const HOLIDAY_FILE = "calendar.days.json";
var settings = require('Storage').readJSON(FILE, true) || {}; const settings = require('Storage').readJSON(FILE, true) || {};
if (settings.ndColors === undefined)
if (process.env.HWVERSION == 2) {
settings.ndColors = true;
} else {
settings.ndColors = false;
}
if (settings.ndColors === undefined) { if (settings.ndColors === undefined) {
if (process.env.HWVERSION == 2) { if (process.env.HWVERSION == 2) {
settings.ndColors = true; settings.ndColors = true;