From 58c48b1b211e733b63bff116949a06b75dd49e6c Mon Sep 17 00:00:00 2001 From: Kristjan Esperanto <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 25 Dec 2021 21:58:30 +0100 Subject: [PATCH 1/6] End-to-End Testing + Format --- .github/CONTRIBUTING.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c93daa37..3d2d1339 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,13 +4,15 @@ Thanks for contributing to MagicMirror²! We hold our code to standard, and these standards are documented below. +## Linters + If you wish to run our linters, use `npm run lint` without any arguments. ### JavaScript: Run ESLint We use [ESLint](https://eslint.org) on our JavaScript files. -Our ESLint configuration is in our .eslintrc.json and .eslintignore files. +Our ESLint configuration is in our `.eslintrc.json` and `.eslintignore` files. To run ESLint, use `npm run lint:js`. @@ -20,7 +22,13 @@ We use [StyleLint](https://stylelint.io) to lint our CSS. Our configuration is i To run StyleLint, use `npm run lint:css`. -### Submitting Issues +## End-to-End Testing + +We use [Jest](https://jestjs.io) for JavaScript Testing. + +To run the test, use `npx jest tests/e2e/env_spec.js`. + +## Submitting Issues Please only submit reproducible issues. From 855860c00ca9af0877c4b9f81e878da6a4cbc71c Mon Sep 17 00:00:00 2001 From: Kristjan Esperanto <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 26 Dec 2021 06:54:46 +0100 Subject: [PATCH 2/6] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 3d2d1339..3563f85e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -22,11 +22,13 @@ We use [StyleLint](https://stylelint.io) to lint our CSS. Our configuration is i To run StyleLint, use `npm run lint:css`. -## End-to-End Testing +## Testing -We use [Jest](https://jestjs.io) for JavaScript Testing. +We use [Jest](https://jestjs.io) for JavaScript testing. -To run the test, use `npx jest tests/e2e/env_spec.js`. +To run all tests, use `npm run test`. + +The specific test commands are defined in `package.json`. So you can also run the specific tests with other commands, e.g. `npm run test:unit` or `npx jest tests/e2e/env_spec.js`. ## Submitting Issues From fc14431147dd1a2b3d87d2c0c762aa97efafdcc4 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Sun, 26 Dec 2021 16:40:17 +0100 Subject: [PATCH 3/6] fix date correction comparison for fulldate, just less than, not less or equal --- modules/default/calendar/calendarutils.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/default/calendar/calendarutils.js b/modules/default/calendar/calendarutils.js index 570a6e7e..a3bfaeab 100644 --- a/modules/default/calendar/calendarutils.js +++ b/modules/default/calendar/calendarutils.js @@ -332,15 +332,15 @@ const CalendarUtils = { Log.debug("Fullday"); // If the offset is negative (east of GMT), where the problem is if (dateoffset < 0) { - //if (dh <= Math.abs(dateoffset / 60)) { - // reduce the time by the offset - // Apply the correction to the date/time to get it UTC relative - date = new Date(date.getTime() - Math.abs(24 * 60) * 60000); - // the duration was calculated way back at the top before we could correct the start time.. - // fix it for this event entry - //duration = 24 * 60 * 60 * 1000; - Log.debug("new recurring date1 is " + date); - //} + if (dh < Math.abs(dateoffset / 60)) { + // reduce the time by the offset + // Apply the correction to the date/time to get it UTC relative + date = new Date(date.getTime() - Math.abs(24 * 60) * 60000); + // the duration was calculated way back at the top before we could correct the start time.. + // fix it for this event entry + //duration = 24 * 60 * 60 * 1000; + Log.debug("new recurring date1 fulldate is " + date); + } } else { // if the timezones are the same, correct date if needed //if (event.start.tz === moment.tz.guess()) { @@ -351,7 +351,7 @@ const CalendarUtils = { // the duration was calculated way back at the top before we could correct the start time.. // fix it for this event entry //duration = 24 * 60 * 60 * 1000; - Log.debug("new recurring date2 is " + date); + Log.debug("new recurring date2 fulldate is " + date); } //} } From 95b587381b57b37d2bda79d69d0e024864fb278f Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Sun, 26 Dec 2021 16:43:14 +0100 Subject: [PATCH 4/6] add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab200cd..0e57ac18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ _This release is scheduled to be released on 2022-01-01._ - Fixed electron tests with retry. - Fixed Calendar recurring cross timezone error (add/subtract a day, not just offset hours) (#2632) - Fixed Calendar showEnd and Full Date overlay (#2629) +- Fixed regression on #2632, #2752 ## [2.17.1] - 2021-10-01 From 28d866c0010954011d99bed4b92cdf7935613869 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Sun, 26 Dec 2021 17:43:27 +0100 Subject: [PATCH 5/6] enable useHTTP for full electron version --- CHANGELOG.md | 1 + js/electron.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6283995..539e33ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ _This release is scheduled to be released on 2022-01-01._ - Fixed User-Agent-Header for newsfeed and calendar module (#2729). - Replace broken shields in Readme and use https for links. - Fixed electron tests with retry. +- Fix useHttp for full version #2749 ## [2.17.1] - 2021-10-01 diff --git a/js/electron.js b/js/electron.js index 2c44ab02..509b5474 100644 --- a/js/electron.js +++ b/js/electron.js @@ -53,7 +53,7 @@ function createWindow() { // If config.address is not defined or is an empty string (listening on all interfaces), connect to localhost let prefix; - if (config["tls"] !== null && config["tls"]) { + if ((config["tls"] !== null && config["tls"]) || config.useHttps) { prefix = "https://"; } else { prefix = "http://"; @@ -140,6 +140,13 @@ app.on("before-quit", (event) => { process.exit(0); }); +/* handle errors from self signed certificates */ + +app.on("certificate-error", (event, webContents, url, error, certificate, callback) => { + event.preventDefault(); + callback(true); +}); + // Start the core application if server is run on localhost // This starts all node helpers and starts the webserver. if (["localhost", "127.0.0.1", "::1", "::ffff:127.0.0.1", undefined].includes(config.address)) { From 446bb229bc0d36da3bf58aaa4a15118ba47921a0 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Sun, 26 Dec 2021 17:53:28 +0100 Subject: [PATCH 6/6] fix changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 539e33ee..2c3f0f7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,9 @@ _This release is scheduled to be released on 2022-01-01._ - Fixed User-Agent-Header for newsfeed and calendar module (#2729). - Replace broken shields in Readme and use https for links. - Fixed electron tests with retry. -- Fix useHttp for full version #2749 +- Fixed Calendar recurring cross timezone error (add/subtract a day, not just offset hours) (#2632) +- Fixed Calendar showEnd and Full Date overlay (#2629) +- Fix useHttps for full version (#2749) ## [2.17.1] - 2021-10-01