Slice the list of all events to honor config.maximumEntries

Scenario:
* Specify more than one calendar in `config.calendars`
* Specify a maximum number of entries in `config.maximumEntries`

Result:
The module will show as many as maximumEntries for EACH calendar

Expected:
The module shall not show more than a total of maximumEntries, regardless of how many calendars I specify

Fixes #1043
This commit is contained in:
Andreas Cederström 2017-10-01 21:36:43 +02:00
parent bad7316b80
commit 2d03ff63cf
2 changed files with 4 additions and 1 deletions

View File

@ -13,6 +13,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Updated ### Updated
### Fixed
- Fixed issue with calendar module showing more than `maximumEntries` allows
## [2.1.3] - 2017-10-01 ## [2.1.3] - 2017-10-01
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install` **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`

View File

@ -356,7 +356,7 @@ Module.register("calendar", {
return a.startDate - b.startDate; return a.startDate - b.startDate;
}); });
return events; return events.slice(0, this.config.maximumEntries);
}, },
/* createEventList(url) /* createEventList(url)