Commit 2289ef7a authored by Mark Stenglein's avatar Mark Stenglein
Browse files

Add support for excluded days in repeating events

parent 4cdb0c71
......@@ -346,6 +346,21 @@ var ICalEvent = function(_data, calendar) {
});
}
if(repeating.exclude) {
if(!Array.isArray(repeating.exclude)) {
repeating.exclude = [repeating.exclude];
}
data.repeating.exclude = [];
repeating.exclude.forEach(function(excludedDate) {
if(typeof excludedDate !== 'date') {
throw '`repeating.exclude` contains invalid value `' + excludedDate + '`!';
}
data.repeating.excludedDate.push(excludedDate);
})
}
return this;
};
......@@ -687,6 +702,13 @@ var ICalEvent = function(_data, calendar) {
g += ';BYMONTHDAY=' + data.repeating.byMonthDay.join(',');
}
if(data.repeating.exclude) {
g += ';EXCLUDE=';
data.repeating.exclude.forEach(function(excludedDate) {
g += tools.formatDate(excludedDate);
});
}
g += '\r\n';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment