mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 12:39:45 +00:00
Support calendar-specific maximumEntries and maximumNumberOfDays
This commit is contained in:
parent
c47852cd0a
commit
14cc642e54
@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Added some missing translaton strings in the sv.json file.
|
- Added some missing translaton strings in the sv.json file.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
- Calendar-specific support for `maximumEntries`, and ` maximumNumberOfDays`
|
||||||
- Add loaded function to modules, providing an async callback.
|
- Add loaded function to modules, providing an async callback.
|
||||||
- Made default newsfeed module aware of gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures)
|
- Made default newsfeed module aware of gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures)
|
||||||
- Add use pm2 for manager process into Installer RaspberryPi script
|
- Add use pm2 for manager process into Installer RaspberryPi script
|
||||||
|
@ -74,4 +74,5 @@ config: {
|
|||||||
-| `repeatingCountTitle` | The count title for yearly repating events in this calendar. <br><br> **Example:** `'Birthday'`
|
-| `repeatingCountTitle` | The count title for yearly repating events in this calendar. <br><br> **Example:** `'Birthday'`
|
||||||
-| `user` | The username for HTTP Basic authentication.
|
-| `user` | The username for HTTP Basic authentication.
|
||||||
-| `pass` | The password for HTTP Basic authentication.
|
-| `pass` | The password for HTTP Basic authentication.
|
||||||
|
-| `maximumEntries` | The maximum number of events shown. Overrides global setting. **Possible values:** `0` - `100`
|
||||||
|
-| `maximumNumberOfDays` | The maximum number of days in the future. Overrides global setting
|
||||||
|
@ -69,7 +69,13 @@ Module.register("calendar", {
|
|||||||
for (var c in this.config.calendars) {
|
for (var c in this.config.calendars) {
|
||||||
var calendar = this.config.calendars[c];
|
var calendar = this.config.calendars[c];
|
||||||
calendar.url = calendar.url.replace("webcal://", "http://");
|
calendar.url = calendar.url.replace("webcal://", "http://");
|
||||||
this.addCalendar(calendar.url, calendar.user, calendar.pass);
|
|
||||||
|
var calendarConfig = {
|
||||||
|
maximumEntries: calendar.maximumEntries,
|
||||||
|
maximumNumberOfDays: calendar.maximumNumberOfDays,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.addCalendar(calendar.url, calendar.user, calendar.pass, calendarConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.calendarData = {};
|
this.calendarData = {};
|
||||||
@ -307,11 +313,11 @@ Module.register("calendar", {
|
|||||||
*
|
*
|
||||||
* argument url sting - Url to add.
|
* argument url sting - Url to add.
|
||||||
*/
|
*/
|
||||||
addCalendar: function (url, user, pass) {
|
addCalendar: function (url, user, pass, calendarConfig) {
|
||||||
this.sendSocketNotification("ADD_CALENDAR", {
|
this.sendSocketNotification("ADD_CALENDAR", {
|
||||||
url: url,
|
url: url,
|
||||||
maximumEntries: this.config.maximumEntries,
|
maximumEntries: calendarConfig.maximumEntries || this.config.maximumEntries,
|
||||||
maximumNumberOfDays: this.config.maximumNumberOfDays,
|
maximumNumberOfDays: calendarConfig.maximumNumberOfDays || this.config.maximumNumberOfDays,
|
||||||
fetchInterval: this.config.fetchInterval,
|
fetchInterval: this.config.fetchInterval,
|
||||||
user: user,
|
user: user,
|
||||||
pass: pass
|
pass: pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user