Add option to configure maximum number of calendar entries.

This commit is contained in:
Michael Teeuw 2015-11-06 13:38:31 +01:00
parent 9a5a74e153
commit 736bf55bd8
2 changed files with 9 additions and 1 deletions

View File

@ -5,7 +5,8 @@ var calendar = {
updateDataInterval: 60000,
fadeInterval: 1000,
intervalId: null,
dataIntervalId: null
dataIntervalId: null,
maximumEntries: config.calendar.maximumEntries || 10
}
calendar.updateData = function (callback) {
@ -15,6 +16,10 @@ calendar.updateData = function (callback) {
this.eventList = [];
for (var i in events) {
if (this.eventList.length >= calendar.maximumEntries) {
break;
}
var e = events[i];
for (var key in e) {
var value = e[key];

View File

@ -33,6 +33,9 @@ var config = {
'Hi, sexy!'
]
},
calendar: {
maximumEntries: 10
},
news: {
feed: 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'
}