From e18dd626707ae0b2c6a7d15f3988180a0b259b0f Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 17 May 2021 11:00:25 +0200 Subject: [PATCH 1/2] Fix calendar day offset --- www/calendar/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/calendar/inner.js b/www/calendar/inner.js index 58262f956..58ad22ac1 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -119,7 +119,7 @@ define([ }; var getWeekDays = function (large) { - var baseDate = new Date(Date.UTC(2017, 0, 1)); // just a Sunday + var baseDate = new Date(2017, 0, 1); // just a Sunday var weekDays = []; for(var i = 0; i < 7; i++) { weekDays.push(baseDate.toLocaleDateString(undefined, { weekday: 'long' })); From 2ed25c38fb6aed00397e645fb9dd8d17aa32eec4 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 18 May 2021 12:25:53 +0530 Subject: [PATCH 2/2] display more information about incorrect headers on checkup page --- www/checkup/main.js | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/www/checkup/main.js b/www/checkup/main.js index 6983e461c..b17709a26 100644 --- a/www/checkup/main.js +++ b/www/checkup/main.js @@ -424,7 +424,11 @@ define([ }); }); - var checkAPIHeaders = function (url, cb) { + var code = function (content) { + return h('code', content); + }; + + var checkAPIHeaders = function (url, msg, cb) { $.ajax(url, { dataType: 'text', complete: function (xhr) { @@ -446,14 +450,29 @@ define([ 'cross-origin-resource-policy': 'cross-origin', 'cross-origin-embedder-policy': 'require-corp', }; - var incorrect = Object.keys(expect).some(function (k) { + var incorrect = false; + + Object.keys(expect).forEach(function (k) { var response = xhr.getResponseHeader(k); - if (response !== expect[k]) { - return true; + var expected = expect[k]; + if (response !== expected) { + incorrect = true; + msg.appendChild(h('p', [ + 'The ', + code(k), + ' header for ', + code(url), + " is '", + code(response), + "' instead of '", + code(expected), + "' as expected.", + ])); + } }); - if (duplicated || incorrect) { console.error(allHeaders); } + if (duplicated || incorrect) { console.debug(allHeaders); } cb(!duplicated && !incorrect); }, }); @@ -464,13 +483,13 @@ define([ assert(function (cb, msg) { var url = '/api/config'; msg.innerText = url + INCORRECT_HEADER_TEXT; - checkAPIHeaders(url, cb); + checkAPIHeaders(url, msg, cb); }); assert(function (cb, msg) { var url = '/api/broadcast'; msg.innerText = url + INCORRECT_HEADER_TEXT; - checkAPIHeaders(url, cb); + checkAPIHeaders(url, msg, cb); }); var setWarningClass = function (msg) {