From 8b0b70e7579de37297e83d28b3979ca0ff6bd83c Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 2 Apr 2019 09:55:20 +0200 Subject: [PATCH 01/33] Prepare 2.8.0-develop. --- CHANGELOG.md | 10 ++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b89b1bc..ef3d183a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ This project adheres to [Semantic Versioning](http://semver.org/). ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core. +## [2.8.0] - Unreleased + +*This release is scheduled to be released on 2019-04-01.* + +### Added + +### Updated + +### Fixed + ## [2.7.1] - 2019-04-02 Fixed `package.json` version number. diff --git a/package-lock.json b/package-lock.json index 9142fc14..d87793e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.7.1", + "version": "2.8.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 14c7874a..37fc0a69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.7.1", + "version": "2.8.0-develop", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { From 1dc530c549c8e397399a40a01985850b17877524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= Date: Tue, 2 Apr 2019 22:59:24 +0300 Subject: [PATCH 02/33] Add translations for FI week/feels --- CHANGELOG.md | 2 ++ translations/fi.json | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef3d183a..5c95844d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added +- Finnish translation for "Feels" and "Weeks" + ### Updated ### Fixed diff --git a/translations/fi.json b/translations/fi.json index aa20759d..495439c1 100644 --- a/translations/fi.json +++ b/translations/fi.json @@ -7,6 +7,8 @@ "RUNNING": "Päättyy {timeUntilEnd} päästä", "EMPTY": "Ei tulevia tapahtumia.", + "WEEK": "Viikko {weekNumber}", + "N": "P", "NNE": "PPI", "NE": "PI", @@ -25,5 +27,7 @@ "NNW": "PPL", "UPDATE_NOTIFICATION": "MagicMirror² päivitys saatavilla.", - "UPDATE_NOTIFICATION_MODULE": "Päivitys saatavilla moduulille {MODULE_NAME}." + "UPDATE_NOTIFICATION_MODULE": "Päivitys saatavilla moduulille {MODULE_NAME}.", + + "FEELS": "Tuntuu kuin" } From c3b3ea107a6153f473416719464d601583b5058d Mon Sep 17 00:00:00 2001 From: darkniki <38648784+darkniki@users.noreply.github.com> Date: Wed, 3 Apr 2019 08:31:40 +0300 Subject: [PATCH 03/33] Update ru.json Added "FEELS" translation --- translations/ru.json | 1 + 1 file changed, 1 insertion(+) diff --git a/translations/ru.json b/translations/ru.json index cf2e5c5f..0512e14b 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -25,6 +25,7 @@ "WNW": "ЗСЗ", "NW": "СЗ", "NNW": "ССЗ", + "FEELS": "По ощущению", "UPDATE_NOTIFICATION": "Есть обновление для MagicMirror².", "UPDATE_NOTIFICATION_MODULE": "Есть обновление для {MODULE_NAME} модуля.", From fd53541719d336f6ab8eaaff82cfefcd89e6277a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Sat, 6 Apr 2019 20:50:54 +0200 Subject: [PATCH 04/33] Handle SIGTERM messages --- js/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/app.js b/js/app.js index 95c9693b..da1d24a8 100644 --- a/js/app.js +++ b/js/app.js @@ -263,6 +263,15 @@ var App = function() { this.stop(); process.exit(0); }); + + /* We also need to listen to SIGTERM signals so we stop everything when we are asked to stop by the OS. + */ + process.on("SIGTERM", () => { + console.log("[SIGTERM] Received. Shutting down server..."); + setTimeout(() => { process.exit(0); }, 3000); // Force quit after 3 seconds + this.stop(); + process.exit(0); + }); }; module.exports = new App(); From 6b87fc64af4fa5dd8a6d0dff1bb4ef08e2e0025a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Sun, 7 Apr 2019 15:26:25 +0200 Subject: [PATCH 05/33] sliceMultiDayEvents is false by default --- modules/default/calendar/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index b2bb5c7f..33d5dade 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -53,7 +53,7 @@ The following properties can be configured: | `hidePrivate` | Hides private calendar events.

**Possible values:** `true` or `false`
**Default value:** `false` | `hideOngoing` | Hides calendar events that have already started.

**Possible values:** `true` or `false`
**Default value:** `false` | `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown.

Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.
**Required**
`filterBy` - string used to determine if filter is applied.
**Optional**
`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]
`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity
`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]`
**Default value:** `[]` -| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `true` +| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `false` ### Calendar configuration From 17425dcaf7cc8cdefda5ff1e7be960060b5c9760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Sun, 7 Apr 2019 16:41:05 +0200 Subject: [PATCH 06/33] Add CHANGELOG entry. Fix test. --- CHANGELOG.md | 1 + js/app.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef3d183a..f674787b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated ### Fixed +- Handle SIGTERM messages ## [2.7.1] - 2019-04-02 diff --git a/js/app.js b/js/app.js index da1d24a8..4a10ba6d 100644 --- a/js/app.js +++ b/js/app.js @@ -263,7 +263,7 @@ var App = function() { this.stop(); process.exit(0); }); - + /* We also need to listen to SIGTERM signals so we stop everything when we are asked to stop by the OS. */ process.on("SIGTERM", () => { From 40f535cf3c02069839a32b6340f086675a130eae Mon Sep 17 00:00:00 2001 From: retroflex Date: Mon, 8 Apr 2019 21:49:19 +0200 Subject: [PATCH 07/33] Added possibility to show event location. --- modules/default/calendar/README.md | 1 + modules/default/calendar/calendar.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index b2bb5c7f..2b5dd242 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -30,6 +30,7 @@ The following properties can be configured: | `maximumNumberOfDays` | The maximum number of days in the future.

**Default value:** `365` | `displaySymbol` | Display a symbol in front of an entry.

**Possible values:** `true` or `false`
**Default value:** `true` | `defaultSymbol` | The default symbol.

**Possible values:** See [Font Awsome](http://fontawesome.io/icons/) website.
**Default value:** `calendar` +| `showLocation` | Whether to show event locations.

**Possible values:** `true` or `false`
**Default value:** `false` | `maxTitleLength` | The maximum title length.

**Possible values:** `10` - `50`
**Default value:** `25` | `wrapEvents` | Wrap event titles to multiple lines. Breaks lines at the length defined by `maxTitleLength`.

**Possible values:** `true` or `false`
**Default value:** `false` | `maxTitleLines` | The maximum number of lines a title will wrap vertically before being cut (Only enabled if `wrapEvents` is also enabled).

**Possible values:** `0` - `10`
**Default value:** `3` diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index d584a9ed..13df45e8 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -15,6 +15,7 @@ Module.register("calendar", { maximumNumberOfDays: 365, displaySymbol: true, defaultSymbol: "calendar", // Fontawesome Symbol see http://fontawesome.io/cheatsheet/ + showLocation: false, displayRepeatingCountTitle: false, defaultRepeatingCountTitle: "", maxTitleLength: 25, @@ -379,6 +380,31 @@ Module.register("calendar", { currentFadeStep = e - startFade; eventWrapper.style.opacity = 1 - (1 / fadeSteps * currentFadeStep); } + + if (this.config.showLocation) { + if (event.location !== false) { + var locationRow = document.createElement("tr"); + locationRow.className = "normal xsmall light"; + + if (this.config.displaySymbol) { + var symbolCell = document.createElement("td"); + locationRow.appendChild(symbolCell); + } + + var descCell = document.createElement("td"); + descCell.className = "location"; + descCell.colSpan = "2"; + descCell.innerHTML = event.location; + locationRow.appendChild(descCell); + + wrapper.appendChild(locationRow); + + if (e >= startFade) { + currentFadeStep = e - startFade; + locationRow.style.opacity = 1 - (1 / fadeSteps * currentFadeStep); + } + } + } } return wrapper; From 4d7b19c8cbd48a26f606090687a47d65817a04cc Mon Sep 17 00:00:00 2001 From: retroflex Date: Mon, 8 Apr 2019 21:57:32 +0200 Subject: [PATCH 08/33] Added calendar event location --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef3d183a..702150d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). *This release is scheduled to be released on 2019-04-01.* ### Added +- Option to show event location in calendar ### Updated From 4677a3fd893799dd31a54afdde90fd40b67f40d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Wed, 10 Apr 2019 10:31:55 +0200 Subject: [PATCH 09/33] Fix many issues with sliceMultiDayEvents --- modules/default/calendar/calendar.js | 43 ++++++++++++++++------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 13df45e8..3aaed2ae 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -462,10 +462,11 @@ Module.register("calendar", { var events = []; var today = moment().startOf("day"); var now = new Date(); + var future = moment().startOf("day").add(this.config.maximumNumberOfDays, "days").toDate(); for (var c in this.calendarData) { var calendar = this.calendarData[c]; for (var e in calendar) { - var event = calendar[e]; + var event = JSON.parse(JSON.stringify(calendar[e])); // clone object if(this.config.hidePrivate) { if(event.class === "PRIVATE") { // do not add the current event, skip it @@ -487,23 +488,30 @@ Module.register("calendar", { * otherwise, esp. in dateheaders mode it is not clear how long these events are. */ if (this.config.sliceMultiDayEvents) { - var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); //next midnight + var splitEvents = []; + var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); var count = 1; - var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf("day").format("x"))/(1000*60*60*24)) + 1 - if (event.endDate > midnight) { - while (event.endDate > midnight) { - var nextEvent = JSON.parse(JSON.stringify(event)); //make a copy without reference to the original event - nextEvent.startDate = midnight; - event.endDate = midnight; - event.title += " (" + count + "/" + maxCount + ")"; - events.push(event); - event = nextEvent; - count += 1; - midnight = moment(midnight, "x").add(1, "day").format("x"); //move further one day for next split - } - event.title += " ("+count+"/"+maxCount+")"; - } - events.push(event); + var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf("day").format("x"))/(1000*60*60*24)) + 1; + while (event.endDate > midnight) { + var thisEvent = JSON.parse(JSON.stringify(event)) // clone object + thisEvent.today = thisEvent.startDate >= today && thisEvent.startDate < (today + 24 * 60 * 60 * 1000); + thisEvent.endDate = midnight; + thisEvent.title += " (" + count + "/" + maxCount + ")"; + splitEvents.push(thisEvent); + + event.startDate = midnight; + count += 1; + midnight = moment(midnight, "x").add(1, "day").format("x"); // next day + } + // Last day + event.title += " ("+count+"/"+maxCount+")"; + splitEvents.push(event); + + for (event of splitEvents) { + if ((event.endDate > now) && (event.endDate <= future)) { + events.push(event); + } + } } else { events.push(event); } @@ -513,7 +521,6 @@ Module.register("calendar", { events.sort(function (a, b) { return a.startDate - b.startDate; }); - return events.slice(0, this.config.maximumEntries); }, From 396c78b46a24fa716c01852fad04a80d1c5446ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Wed, 10 Apr 2019 10:35:11 +0200 Subject: [PATCH 10/33] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 245173d8..3acf8b50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Handle SIGTERM messages +- Fixes sliceMultiDayEvents so it respects maximumNumberOfDays ## [2.7.1] - 2019-04-02 From ef554cf6eccd41fe83d768b1789601824c05f06e Mon Sep 17 00:00:00 2001 From: darkniki <38648784+darkniki@users.noreply.github.com> Date: Thu, 11 Apr 2019 14:46:32 +0300 Subject: [PATCH 11/33] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 245173d8..d77ce14f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Finnish translation for "Feels" and "Weeks" +- Russian translation for “Feels” + ### Updated ### Fixed From 806be39a6d549e17c663e906b8dd3349612bfc8e Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Mon, 1 Apr 2019 15:39:25 -0400 Subject: [PATCH 12/33] Add includePastEvents global and calendar-specific settings --- CHANGELOG.md | 1 + modules/default/calendar/README.md | 2 ++ modules/default/calendar/calendar.js | 12 ++++++-- modules/default/calendar/calendarfetcher.js | 32 ++++++++++++++------- modules/default/calendar/debug.js | 1 + modules/default/calendar/node_helper.js | 6 ++-- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e0f65f3..333be48f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Fixed `package.json` version number. - Notifications display time can be set in request - Newsfeed: added support for `ARTICLE_INFO_REQUEST` notification - Add `name` config option for calendars to be sent along with event broadcasts +- Add `includePastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 65362a81..8f8a6d12 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -55,6 +55,7 @@ The following properties can be configured: | `hideOngoing` | Hides calendar events that have already started.

**Possible values:** `true` or `false`
**Default value:** `false` | `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown.

Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.
**Required**
`filterBy` - string used to determine if filter is applied.
**Optional**
`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]
`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity
`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]`
**Default value:** `[]` | `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `false` +| `includePastEvents` | If this is set to true, events from the past `maximumNumberOfDays` will be included in event broadcasts
**Default value:** `false` ### Calendar configuration @@ -96,6 +97,7 @@ config: { | `symbolClass` | Add a class to the cell of symbol. | `titleClass` | Add a class to the title's cell. | `timeClass` | Add a class to the time's cell. +| `includePastEvents` | Whether to include past events from this calendar. Overrides global setting #### Calendar authentication options: diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 3aaed2ae..ee342153 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -49,7 +49,8 @@ Module.register("calendar", { }, broadcastEvents: true, excludedEvents: [], - sliceMultiDayEvents: false + sliceMultiDayEvents: false, + includePastEvents: false, }, // Define required scripts. @@ -83,7 +84,8 @@ Module.register("calendar", { var calendarConfig = { maximumEntries: calendar.maximumEntries, - maximumNumberOfDays: calendar.maximumNumberOfDays + maximumNumberOfDays: calendar.maximumNumberOfDays, + includePastEvents: calendar.includePastEvents, }; if (calendar.symbolClass === "undefined" || calendar.symbolClass === null) { calendarConfig.symbolClass = ""; @@ -467,6 +469,9 @@ Module.register("calendar", { var calendar = this.calendarData[c]; for (var e in calendar) { var event = JSON.parse(JSON.stringify(calendar[e])); // clone object + if(event.endDate < now) { + continue; + } if(this.config.hidePrivate) { if(event.class === "PRIVATE") { // do not add the current event, skip it @@ -550,7 +555,8 @@ Module.register("calendar", { symbolClass: calendarConfig.symbolClass, titleClass: calendarConfig.titleClass, timeClass: calendarConfig.timeClass, - auth: auth + auth: auth, + includePastEvents: calendarConfig.includePastEvents || this.config.includePastEvents, }); }, diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 0076a605..3a30aea2 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -8,7 +8,7 @@ var ical = require("./vendor/ical.js"); var moment = require("moment"); -var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth) { +var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents) { var self = this; var reloadTimer = null; @@ -74,6 +74,11 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri var now = new Date(); var today = moment().startOf("day").toDate(); var future = moment().startOf("day").add(maximumNumberOfDays, "days").subtract(1,"seconds").toDate(); // Subtract 1 second so that events that start on the middle of the night will not repeat. + var past = today; + + if (includePastEvents) { + past = moment().startOf("day").subtract(maximumNumberOfDays, "days").toDate(); + } // FIXME: // Ugly fix to solve the facebook birthday issue. @@ -181,7 +186,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri rule.options.dtstart.setYear(1900); } - var dates = rule.between(today, future, true, limitFunction); + var dates = rule.between(past, future, true, limitFunction); for (var d in dates) { startDate = moment(new Date(dates[d])); @@ -191,7 +196,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri continue; } - if (endDate.format("x") > now) { + if (includePastEvents || endDate.format("x") > now) { newEvents.push({ title: title, startDate: startDate.format("x"), @@ -210,14 +215,21 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri // Single event. var fullDayEvent = (isFacebookBirthday) ? true : isFullDayEvent(event); - if (!fullDayEvent && endDate < new Date()) { - //console.log("It's not a fullday event, and it is in the past. So skip: " + title); - continue; - } + if (includePastEvents) { + if (endDate < past) { + //console.log("Past event is too far in the past. So skip: " + title); + continue; + } + } else { + if (!fullDayEvent && endDate < new Date()) { + //console.log("It's not a fullday event, and it is in the past. So skip: " + title); + continue; + } - if (fullDayEvent && endDate <= today) { - //console.log("It's a fullday event, and it is before today. So skip: " + title); - continue; + if (fullDayEvent && endDate <= today) { + //console.log("It's a fullday event, and it is before today. So skip: " + title); + continue; + } } if (startDate > future) { diff --git a/modules/default/calendar/debug.js b/modules/default/calendar/debug.js index ddf0fb42..b8295d66 100644 --- a/modules/default/calendar/debug.js +++ b/modules/default/calendar/debug.js @@ -15,6 +15,7 @@ var maximumEntries = 10; var maximumNumberOfDays = 365; var user = "magicmirror"; var pass = "MyStrongPass"; +var includePastEvents = false; var auth = { user: user, diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index 25e7f1f7..30c28e9d 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -24,7 +24,7 @@ module.exports = NodeHelper.create({ socketNotificationReceived: function(notification, payload) { if (notification === "ADD_CALENDAR") { //console.log('ADD_CALENDAR: '); - this.createFetcher(payload.url, payload.fetchInterval, payload.excludedEvents, payload.maximumEntries, payload.maximumNumberOfDays, payload.auth); + this.createFetcher(payload.url, payload.fetchInterval, payload.excludedEvents, payload.maximumEntries, payload.maximumNumberOfDays, payload.auth, payload.includePastEvents); } }, @@ -36,7 +36,7 @@ module.exports = NodeHelper.create({ * attribute reloadInterval number - Reload interval in milliseconds. */ - createFetcher: function(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth) { + createFetcher: function(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents) { var self = this; if (!validUrl.isUri(url)) { @@ -47,7 +47,7 @@ module.exports = NodeHelper.create({ var fetcher; if (typeof self.fetchers[url] === "undefined") { console.log("Create new calendar fetcher for url: " + url + " - Interval: " + fetchInterval); - fetcher = new CalendarFetcher(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth); + fetcher = new CalendarFetcher(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents); fetcher.onReceive(function(fetcher) { //console.log('Broadcast events.'); From c61f0409fb8d65f71fca9ca29015ffd864a802e3 Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Wed, 10 Apr 2019 16:50:18 -0400 Subject: [PATCH 13/33] Rename includePastEvents calendar config option to broadcastPastEvents --- CHANGELOG.md | 3 ++- modules/default/calendar/README.md | 4 ++-- modules/default/calendar/calendar.js | 6 +++--- modules/default/calendar/debug.js | 2 +- modules/default/calendar/node_helper.js | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 333be48f..056f23b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Russian translation for “Feels” +- Add `broadcastPastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts + ### Updated ### Fixed @@ -44,7 +46,6 @@ Fixed `package.json` version number. - Notifications display time can be set in request - Newsfeed: added support for `ARTICLE_INFO_REQUEST` notification - Add `name` config option for calendars to be sent along with event broadcasts -- Add `includePastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts ### Updated - Bumped the Electron dependency to v3.0.13 to support the most recent Raspbian. [#1500](https://github.com/MichMich/MagicMirror/issues/1500) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 8f8a6d12..786f7362 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -55,7 +55,7 @@ The following properties can be configured: | `hideOngoing` | Hides calendar events that have already started.

**Possible values:** `true` or `false`
**Default value:** `false` | `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown.

Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.
**Required**
`filterBy` - string used to determine if filter is applied.
**Optional**
`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]
`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity
`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]`
**Default value:** `[]` | `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `false` -| `includePastEvents` | If this is set to true, events from the past `maximumNumberOfDays` will be included in event broadcasts
**Default value:** `false` +| `broadcastPastEvents` | If this is set to true, events from the past `maximumNumberOfDays` will be included in event broadcasts
**Default value:** `false` ### Calendar configuration @@ -97,7 +97,7 @@ config: { | `symbolClass` | Add a class to the cell of symbol. | `titleClass` | Add a class to the title's cell. | `timeClass` | Add a class to the time's cell. -| `includePastEvents` | Whether to include past events from this calendar. Overrides global setting +| `broadcastPastEvents` | Whether to include past events from this calendar. Overrides global setting #### Calendar authentication options: diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index ee342153..45009934 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -50,7 +50,7 @@ Module.register("calendar", { broadcastEvents: true, excludedEvents: [], sliceMultiDayEvents: false, - includePastEvents: false, + broadcastPastEvents: false, }, // Define required scripts. @@ -85,7 +85,7 @@ Module.register("calendar", { var calendarConfig = { maximumEntries: calendar.maximumEntries, maximumNumberOfDays: calendar.maximumNumberOfDays, - includePastEvents: calendar.includePastEvents, + broadcastPastEvents: calendar.broadcastPastEvents, }; if (calendar.symbolClass === "undefined" || calendar.symbolClass === null) { calendarConfig.symbolClass = ""; @@ -556,7 +556,7 @@ Module.register("calendar", { titleClass: calendarConfig.titleClass, timeClass: calendarConfig.timeClass, auth: auth, - includePastEvents: calendarConfig.includePastEvents || this.config.includePastEvents, + broadcastPastEvents: calendarConfig.broadcastPastEvents || this.config.broadcastPastEvents, }); }, diff --git a/modules/default/calendar/debug.js b/modules/default/calendar/debug.js index b8295d66..a568e1cd 100644 --- a/modules/default/calendar/debug.js +++ b/modules/default/calendar/debug.js @@ -15,7 +15,7 @@ var maximumEntries = 10; var maximumNumberOfDays = 365; var user = "magicmirror"; var pass = "MyStrongPass"; -var includePastEvents = false; +var broadcastPastEvents = false; var auth = { user: user, diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index 30c28e9d..9c6e4979 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -24,7 +24,7 @@ module.exports = NodeHelper.create({ socketNotificationReceived: function(notification, payload) { if (notification === "ADD_CALENDAR") { //console.log('ADD_CALENDAR: '); - this.createFetcher(payload.url, payload.fetchInterval, payload.excludedEvents, payload.maximumEntries, payload.maximumNumberOfDays, payload.auth, payload.includePastEvents); + this.createFetcher(payload.url, payload.fetchInterval, payload.excludedEvents, payload.maximumEntries, payload.maximumNumberOfDays, payload.auth, payload.broadcastPastEvents); } }, @@ -36,7 +36,7 @@ module.exports = NodeHelper.create({ * attribute reloadInterval number - Reload interval in milliseconds. */ - createFetcher: function(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents) { + createFetcher: function(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, broadcastPastEvents) { var self = this; if (!validUrl.isUri(url)) { @@ -47,7 +47,7 @@ module.exports = NodeHelper.create({ var fetcher; if (typeof self.fetchers[url] === "undefined") { console.log("Create new calendar fetcher for url: " + url + " - Interval: " + fetchInterval); - fetcher = new CalendarFetcher(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents); + fetcher = new CalendarFetcher(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, broadcastPastEvents); fetcher.onReceive(function(fetcher) { //console.log('Broadcast events.'); From e2d2dbd2baa5420b603e90fa400810f2cb6faecf Mon Sep 17 00:00:00 2001 From: magic21nrw Date: Wed, 17 Apr 2019 20:05:33 +0200 Subject: [PATCH 14/33] Update ical.js Fixed Bug with more than one calendar. --- .../default/calendar/vendor/ical.js/ical.js | 295 ++++++++++++------ 1 file changed, 204 insertions(+), 91 deletions(-) diff --git a/modules/default/calendar/vendor/ical.js/ical.js b/modules/default/calendar/vendor/ical.js/ical.js index 8f0c532b..024625b7 100644 --- a/modules/default/calendar/vendor/ical.js/ical.js +++ b/modules/default/calendar/vendor/ical.js/ical.js @@ -33,9 +33,9 @@ for (var i = 0; i Date: Wed, 17 Apr 2019 21:16:36 -0500 Subject: [PATCH 15/33] Update English Feels to Feels like --- CHANGELOG.md | 5 ++--- translations/en.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e0f65f3..134dc4c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,16 +9,15 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [2.8.0] - Unreleased -*This release is scheduled to be released on 2019-04-01.* +*This release is scheduled to be released on 2019-07-01.* ### Added - Option to show event location in calendar - - Finnish translation for "Feels" and "Weeks" - - Russian translation for “Feels” ### Updated +- English translation for "Feels" to "Feels like" ### Fixed - Handle SIGTERM messages diff --git a/translations/en.json b/translations/en.json index 900bf630..5a098801 100644 --- a/translations/en.json +++ b/translations/en.json @@ -31,5 +31,5 @@ "UPDATE_INFO_SINGLE": "The current installation is {COMMIT_COUNT} commit behind on the {BRANCH_NAME} branch.", "UPDATE_INFO_MULTIPLE": "The current installation is {COMMIT_COUNT} commits behind on the {BRANCH_NAME} branch.", - "FEELS": "Feels" + "FEELS": "Feels like" } From 3c7a85361e969e7ce4d31dfc376bef9e2888c66b Mon Sep 17 00:00:00 2001 From: kevbodavidson Date: Wed, 24 Apr 2019 17:19:47 -0400 Subject: [PATCH 16/33] Update config.js.sample --- config/config.js.sample | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/config.js.sample b/config/config.js.sample index 6e419e59..195adebc 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -45,8 +45,7 @@ var config = { calendars: [ { symbol: "calendar-check", - url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics" - } + url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics" } ] } }, From 7047a7cae6cc791e6bc06d30a36d96058e72b9e2 Mon Sep 17 00:00:00 2001 From: magic21nrw Date: Wed, 17 Apr 2019 20:05:33 +0200 Subject: [PATCH 17/33] Update ical.js Fixed Bug with more than one calendar. --- .../default/calendar/vendor/ical.js/ical.js | 295 ++++++++++++------ 1 file changed, 204 insertions(+), 91 deletions(-) diff --git a/modules/default/calendar/vendor/ical.js/ical.js b/modules/default/calendar/vendor/ical.js/ical.js index 8f0c532b..024625b7 100644 --- a/modules/default/calendar/vendor/ical.js/ical.js +++ b/modules/default/calendar/vendor/ical.js/ical.js @@ -33,9 +33,9 @@ for (var i = 0; i Date: Tue, 7 May 2019 19:46:23 +0200 Subject: [PATCH 18/33] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 134dc4c5..ef05509b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated - English translation for "Feels" to "Feels like" +- Update `ical.js` to solve various calendar issues. ### Fixed - Handle SIGTERM messages From 20b75ce6edd7eb515aede883e6f4522e6a2bc680 Mon Sep 17 00:00:00 2001 From: kevbodavidson Date: Wed, 24 Apr 2019 17:19:47 -0400 Subject: [PATCH 19/33] Update config.js.sample --- config/config.js.sample | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/config.js.sample b/config/config.js.sample index 6e419e59..195adebc 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -45,8 +45,7 @@ var config = { calendars: [ { symbol: "calendar-check", - url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics" - } + url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics" } ] } }, From bcfbccae592b958be048b2ae86de3a2204ebd2ae Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 7 May 2019 20:06:03 +0200 Subject: [PATCH 20/33] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 134dc4c5..3f0bd151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated - English translation for "Feels" to "Feels like" +- Fixed the example calender url in `config.js.sample` ### Fixed - Handle SIGTERM messages From a17ac1c16e6bec608bcc9dc5b9bf47bb1707ea43 Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:03:55 +0200 Subject: [PATCH 21/33] added Config Option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/calendar.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 3aaed2ae..7133caaa 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -49,7 +49,8 @@ Module.register("calendar", { }, broadcastEvents: true, excludedEvents: [], - sliceMultiDayEvents: false + sliceMultiDayEvents: false, + nextDaysRelative: false }, // Define required scripts. @@ -326,7 +327,7 @@ Module.register("calendar", { // If event is within 6 hour, display 'in xxx' time format or moment.fromNow() timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } else { - if(this.config.timeFormat === "absolute") { + if(this.config.timeFormat === "absolute" && !this.config.nextDaysRelative) { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat)); } else { // Otherwise just say 'Today/Tomorrow at such-n-such time' From d24e10a72853aeabf12af3c64c8af783b8a53c5b Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:06:47 +0200 Subject: [PATCH 22/33] added config option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 65362a81..33d09274 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -54,8 +54,8 @@ The following properties can be configured: | `hidePrivate` | Hides private calendar events.

**Possible values:** `true` or `false`
**Default value:** `false` | `hideOngoing` | Hides calendar events that have already started.

**Possible values:** `true` or `false`
**Default value:** `false` | `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown.

Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.
**Required**
`filterBy` - string used to determine if filter is applied.
**Optional**
`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]
`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity
`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]`
**Default value:** `[]` -| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `false` - +| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59
**Default value:** `true` +| `nextDaysRelative ` | If this is set to true, the appointments of today and tomorrow are displayed relatively, even if the timeformat is set to absolute.
**Default value:** `false` ### Calendar configuration From 03f917fd9c026dc2fc3bf74aec8d2f08a415daa6 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 7 May 2019 20:31:41 +0200 Subject: [PATCH 23/33] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 134dc4c5..3391b9fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Option to show event location in calendar - Finnish translation for "Feels" and "Weeks" - Russian translation for “Feels” +- Calendar module: added `nextDaysRelative` config option ### Updated - English translation for "Feels" to "Feels like" From 7e2ab51298f0e8476c95f515c594db09271d9d19 Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:03:55 +0200 Subject: [PATCH 24/33] added Config Option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/calendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 45009934..1b1fbc51 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -51,6 +51,7 @@ Module.register("calendar", { excludedEvents: [], sliceMultiDayEvents: false, broadcastPastEvents: false, + nextDaysRelative: false }, // Define required scripts. @@ -328,7 +329,7 @@ Module.register("calendar", { // If event is within 6 hour, display 'in xxx' time format or moment.fromNow() timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } else { - if(this.config.timeFormat === "absolute") { + if(this.config.timeFormat === "absolute" && !this.config.nextDaysRelative) { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat)); } else { // Otherwise just say 'Today/Tomorrow at such-n-such time' From 41e5c2939f74a1dc6132c587f6e6977a6f70b891 Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:06:47 +0200 Subject: [PATCH 25/33] added config option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 786f7362..eb9324f2 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -54,9 +54,9 @@ The following properties can be configured: | `hidePrivate` | Hides private calendar events.

**Possible values:** `true` or `false`
**Default value:** `false` | `hideOngoing` | Hides calendar events that have already started.

**Possible values:** `true` or `false`
**Default value:** `false` | `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown.

Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.
**Required**
`filterBy` - string used to determine if filter is applied.
**Optional**
`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]
`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity
`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]`
**Default value:** `[]` -| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `false` | `broadcastPastEvents` | If this is set to true, events from the past `maximumNumberOfDays` will be included in event broadcasts
**Default value:** `false` - +| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59
**Default value:** `true` +| `nextDaysRelative ` | If this is set to true, the appointments of today and tomorrow are displayed relatively, even if the timeformat is set to absolute.
**Default value:** `false` ### Calendar configuration From 17c581b4aa52bdf9f2f12a984f91a2620aa62908 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 7 May 2019 20:31:41 +0200 Subject: [PATCH 26/33] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a1b9b4b..a5dff53a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Option to show event location in calendar - Finnish translation for "Feels" and "Weeks" - Russian translation for “Feels” +- Calendar module: added `nextDaysRelative` config option - Add `broadcastPastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts From ccb248db91915dcab5f4fbe2648d4040d863a09e Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 7 May 2019 21:09:11 +0200 Subject: [PATCH 27/33] Create stale.yml --- .github/stale.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 00000000..136532c1 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,19 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security + - under investigation + - pr welcome +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false From 94fc4cb8a2f355d3e470930992a0b1d9255d9ccc Mon Sep 17 00:00:00 2001 From: Seongnoh Sean Yi Date: Mon, 13 May 2019 21:19:50 +0200 Subject: [PATCH 28/33] allow html5 autoplay policy From Chrome 66, autoplay policy is changed. This 1 line can help to play html5 audio and video without user-gesture-allowance in MagicMirror --- js/electron.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/electron.js b/js/electron.js index fc6ab98e..21d8be8a 100644 --- a/js/electron.js +++ b/js/electron.js @@ -17,6 +17,7 @@ const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { + app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required'); var electronOptionsDefaults = { width: 800, height: 600, From ef9576f8c48aeb04401daf929352762e491fdf18 Mon Sep 17 00:00:00 2001 From: Seongnoh Sean Yi Date: Mon, 13 May 2019 21:26:28 +0200 Subject: [PATCH 29/33] Fixed:allowance HTML5 autoplay From commit: https://github.com/eouia/MagicMirror/commit/94fc4cb8a2f355d3e470930992a0b1d9255d9ccc --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8571e72f..c72d0f0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Update `ical.js` to solve various calendar issues. ### Fixed +- Allowance HTML5 autoplay-policy (policy is changed from Chrome 66 updates) - Handle SIGTERM messages - Fixes sliceMultiDayEvents so it respects maximumNumberOfDays From 3796076360de884a8cf58ac13e7b2e521a09bfca Mon Sep 17 00:00:00 2001 From: Seongnoh Sean Yi Date: Mon, 13 May 2019 23:24:59 +0200 Subject: [PATCH 30/33] change Squotes to Dquotes --- js/electron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/electron.js b/js/electron.js index 21d8be8a..c5e9c4cb 100644 --- a/js/electron.js +++ b/js/electron.js @@ -17,7 +17,7 @@ const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { - app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required'); + app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required"); var electronOptionsDefaults = { width: 800, height: 600, From 727eb0cfd77100a9d9c87429137d459f79a1b037 Mon Sep 17 00:00:00 2001 From: Matt Bauer Date: Tue, 14 May 2019 09:53:34 -0500 Subject: [PATCH 31/33] Calendar: only slice multi-day events when they actually span midnight --- modules/default/calendar/calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 1b1fbc51..2eac086e 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -493,11 +493,11 @@ Module.register("calendar", { /* if sliceMultiDayEvents is set to true, multiday events (events exceeding at least one midnight) are sliced into days, * otherwise, esp. in dateheaders mode it is not clear how long these events are. */ - if (this.config.sliceMultiDayEvents) { + var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf("day").format("x"))/(1000*60*60*24)) + 1; + if (this.config.sliceMultiDayEvents && maxCount > 1) { var splitEvents = []; var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); var count = 1; - var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf("day").format("x"))/(1000*60*60*24)) + 1; while (event.endDate > midnight) { var thisEvent = JSON.parse(JSON.stringify(event)) // clone object thisEvent.today = thisEvent.startDate >= today && thisEvent.startDate < (today + 24 * 60 * 60 * 1000); From 7240fb32d22ce9cd814160f4bcfb4d7c5b8ab90b Mon Sep 17 00:00:00 2001 From: vincep5 Date: Tue, 14 May 2019 15:00:30 -0500 Subject: [PATCH 32/33] update city list url --- CHANGELOG.md | 1 + config/config.js.sample | 4 ++-- modules/default/currentweather/README.md | 2 +- modules/default/weather/forecast.njk | 2 +- modules/default/weatherforecast/README.md | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8571e72f..7e752a25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - English translation for "Feels" to "Feels like" - Fixed the example calender url in `config.js.sample` - Update `ical.js` to solve various calendar issues. +- Update weather city list url [#1676](https://github.com/MichMich/MagicMirror/issues/1676) ### Fixed - Handle SIGTERM messages diff --git a/config/config.js.sample b/config/config.js.sample index 195adebc..8ec8622f 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -58,7 +58,7 @@ var config = { position: "top_right", config: { location: "New York", - locationID: "", //ID from http://bulk.openweathermap.org/sample/; unzip the gz file and find your city + locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "YOUR_OPENWEATHER_API_KEY" } }, @@ -68,7 +68,7 @@ var config = { header: "Weather Forecast", config: { location: "New York", - locationID: "5128581", //ID from https://openweathermap.org/city + locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "YOUR_OPENWEATHER_API_KEY" } }, diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index ce8cd19e..a88eeaf1 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -19,7 +19,7 @@ modules: [ config: { // See 'Configuration options' for more information. location: "Amsterdam,Netherlands", - locationID: "", //Location ID from http://openweathermap.org/help/city_list.txt + locationID: "", //Location ID from http://bulk.openweathermap.org/sample/city.list.json.gz appid: "abcde12345abcde12345abcde12345ab" //openweathermap.org API key. } } diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 8e997c85..fed0e85c 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -28,5 +28,5 @@ {% endif %} - + diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 4be3d9bf..a75cb984 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -19,7 +19,7 @@ modules: [ config: { // See 'Configuration options' for more information. location: "Amsterdam,Netherlands", - locationID: "", //Location ID from http://openweathermap.org/help/city_list.txt + locationID: "", //Location ID from http://bulk.openweathermap.org/sample/city.list.json.gz appid: "abcde12345abcde12345abcde12345ab" //openweathermap.org API key. } } From 44eccf5ee4e1905e6cc4deb9bb1579850592adaf Mon Sep 17 00:00:00 2001 From: Jon Kolb Date: Sat, 18 May 2019 20:00:53 -0400 Subject: [PATCH 33/33] Only call updateDom in clock.js when the content has changed --- CHANGELOG.md | 1 + modules/default/clock/clock.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e48b3144..1a375192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed the example calender url in `config.js.sample` - Update `ical.js` to solve various calendar issues. - Update weather city list url [#1676](https://github.com/MichMich/MagicMirror/issues/1676) +- Only update clock once per minute when seconds aren't shown ### Fixed - Allowance HTML5 autoplay-policy (policy is changed from Chrome 66 updates) diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 23b801d0..e4942076 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -41,8 +41,11 @@ Module.register("clock",{ // Schedule update interval. var self = this; + self.lastDisplayedMinute = null; setInterval(function() { - self.updateDom(); + if (self.config.displaySeconds || self.lastDisplayedMinute !== moment().minute()) { + self.updateDom(); + } }, 1000); // Set locale. @@ -75,6 +78,7 @@ Module.register("clock",{ // See issue: https://github.com/MichMich/MagicMirror/issues/181 var timeString; var now = moment(); + this.lastDisplayedMinute = now.minute(); if (this.config.timezone) { now.tz(this.config.timezone); }