Merge pull request #3 from MichMich/develop

Update the develop branch from the original repository
This commit is contained in:
György Balássy 2018-08-30 00:00:56 +02:00 committed by GitHub
commit 61d5f39408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 9 deletions

View File

@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
--- ---
## [2.5.0] - Unreleased ## [2.5.0] - Unreleased
*This release is scheduled to be released on 2018-10-01.* *This release is scheduled to be released on 2018-10-01.*
@ -15,11 +16,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Hungarian translation for "Feels" and "Week" - Hungarian translation for "Feels" and "Week"
- Spanish translation for "Feels" - Spanish translation for "Feels"
- Add classes instead of inline style to the message from the module Alert - Add classes instead of inline style to the message from the module Alert
- Fix for weatherforecast rainfall rounding [#1374](https://github.com/MichMich/MagicMirror/issues/1374) - Support for events having a duration instead of an end
- Support for showing end of events through config parameters showEnd and dateEndFormat
### Fixed ### Fixed
- Mixup between german and spanish translation for newsfeed. - Mixup between german and spanish translation for newsfeed.
- Fixed close dates to be absolute, if no configured in the config.js - module Calendar - Fixed close dates to be absolute, if no configured in the config.js - module Calendar
- Fix for weatherforecast rainfall rounding [#1374](https://github.com/MichMich/MagicMirror/issues/1374)
- Fix calendar parsing issue for Midori on RasperryPi Zero w, related to issue #694.
- Fix weather city ID link in sample config
- Fixed issue with clientonly not updating with IP address and port provided on command line.
### Updated ### Updated
@ -27,6 +33,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Hungarian translations for the updatenotification module - Hungarian translations for the updatenotification module
- Updated Norsk bokmål translation - Updated Norsk bokmål translation
- Updated Norsk nynorsk translation - Updated Norsk nynorsk translation
- Consider multi days event as full day events
## [2.4.1] - 2018-07-04 ## [2.4.1] - 2018-07-04

View File

@ -62,13 +62,13 @@
// Only start the client if a non-local server was provided // Only start the client if a non-local server was provided
if (["localhost", "127.0.0.1", "::1", "::ffff:127.0.0.1", undefined].indexOf(config.address) === -1) { if (["localhost", "127.0.0.1", "::1", "::ffff:127.0.0.1", undefined].indexOf(config.address) === -1) {
getServerConfig(`http://${config.address}:${config.port}/config/`) getServerConfig(`http://${config.address}:${config.port}/config/`)
.then(function (config) { .then(function (configReturn) {
// Pass along the server config via an environment variable // Pass along the server config via an environment variable
var env = Object.create(process.env); var env = Object.create(process.env);
var options = { env: env }; var options = { env: env };
config.address = config.address; configReturn.address = config.address;
config.port = config.port; configReturn.port = config.port;
env.config = JSON.stringify(config); env.config = JSON.stringify(configReturn);
// Spawn electron application // Spawn electron application
const electron = require("electron"); const electron = require("electron");

View File

@ -59,7 +59,7 @@ var config = {
position: "top_right", position: "top_right",
config: { config: {
location: "New York", location: "New York",
locationID: "", //ID from http://www.openweathermap.org/help/city_list.txt locationID: "", //ID from http://bulk.openweathermap.org/sample/; unzip the gz file and find your city
appid: "YOUR_OPENWEATHER_API_KEY" appid: "YOUR_OPENWEATHER_API_KEY"
} }
}, },

View File

@ -25,7 +25,9 @@ Module.register("calendar", {
urgency: 7, urgency: 7,
timeFormat: "relative", timeFormat: "relative",
dateFormat: "MMM Do", dateFormat: "MMM Do",
dateEndFormat: "HH:mm",
fullDayEventDateFormat: "MMM Do", fullDayEventDateFormat: "MMM Do",
showEnd: true,
getRelative: 6, getRelative: 6,
fadePoint: 0.25, // Start on 1/4th of the list. fadePoint: 0.25, // Start on 1/4th of the list.
hidePrivate: false, hidePrivate: false,
@ -287,6 +289,10 @@ Module.register("calendar", {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
} }
} }
if(this.config.showEnd){
timeWrapper.innerHTML += "-" ;
timeWrapper.innerHTML += this.capFirst(moment(event.endDate , "x").format(this.config.fullDayEventDateFormat));
}
} else { } else {
if (event.startDate >= new Date()) { if (event.startDate >= new Date()) {
if (event.startDate - now < 2 * oneDay) { if (event.startDate - now < 2 * oneDay) {
@ -329,6 +335,11 @@ Module.register("calendar", {
}) })
); );
} }
if (this.config.showEnd) {
timeWrapper.innerHTML += "-";
timeWrapper.innerHTML += this.capFirst(moment(event.endDate, "x").format(this.config.dateEndFormat));
}
} }
//timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll'); //timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll');
//console.log(event); //console.log(event);
@ -440,7 +451,7 @@ Module.register("calendar", {
listContainsEvent: function(eventList, event){ listContainsEvent: function(eventList, event){
for(let evt of eventList){ for(var evt of eventList){
if(evt.title === event.title && parseInt(evt.startDate) === parseInt(event.startDate)){ if(evt.title === event.title && parseInt(evt.startDate) === parseInt(event.startDate)){
return true; return true;
} }

View File

@ -90,6 +90,9 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
var endDate; var endDate;
if (typeof event.end !== "undefined") { if (typeof event.end !== "undefined") {
endDate = eventDate(event, "end"); endDate = eventDate(event, "end");
} else if(typeof event.duration !== "undefined") {
dur=moment.duration(event.duration);
endDate = startDate.clone().add(dur);
} else { } else {
if (!isFacebookBirthday) { if (!isFacebookBirthday) {
endDate = startDate; endDate = startDate;
@ -273,8 +276,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
var start = event.start || 0; var start = event.start || 0;
var startDate = new Date(start); var startDate = new Date(start);
var end = event.end || 0; var end = event.end || 0;
if (((end - start) % (24 * 60 * 60 * 1000)) === 0 && startDate.getHours() === 0 && startDate.getMinutes() === 0) {
if (end - start === 24 * 60 * 60 * 1000 && startDate.getHours() === 0 && startDate.getMinutes() === 0) {
// Is 24 hours, and starts on the middle of the night. // Is 24 hours, and starts on the middle of the night.
return true; return true;
} }