Unverified Commit dc234fb2 authored by Mark Stenglein's avatar Mark Stenglein
Browse files

Add test case to actually check the generation of the EXDATE parameter

parent e3218ab8
......@@ -353,8 +353,13 @@ var ICalEvent = function(_data, calendar) {
data.repeating.exclude = [];
repeating.exclude.forEach(function(excludedDate) {
if(Object.prototype.toString.call(excludedDate) !== '[object Date]') {
throw '`repeating.exclude` contains invalid value `' + excludedDate + '`!';
var originalDate = excludedDate;
if(typeof(excludedDate == 'string')) {
excludedDate = new Date(excludedDate);
}
if(Object.prototype.toString.call(excludedDate) !== '[object Date]' || isNaN(excludedDate.getTime())) {
throw '`repeating.exclude` contains invalid value `' + originalDate + '`!';
}
data.repeating.exclude.push(excludedDate);
......
......@@ -8,6 +8,7 @@ DTSTAMP:20131004T233453Z
DTSTART:20131004T223930Z
DTEND:20131006T231500Z
RRULE:FREQ=MONTHLY
EXDATE:20131006T231500Z
SUMMARY:repeating by month
END:VEVENT
BEGIN:VEVENT
......
......@@ -1478,7 +1478,8 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
stamp: new Date('Fr Oct 04 2013 23:34:53 UTC'),
summary: 'repeating by month',
repeating: {
freq: 'monthly'
freq: 'monthly',
exclude: new Date('Fr Oct 06 2013 23:15:00 UTC')
}
},
{
......
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