Commit 494fc64d authored by Andi Sidwell's avatar Andi Sidwell
Browse files

Stop throwing errors when no end date provided

parent c8fc0cf7
......@@ -562,9 +562,6 @@ var ICalEvent = function(_data) {
if(!data.start) {
throw 'No value for `start` in ICalEvent #' + data.id + ' given!';
}
if(!data.end) {
throw 'No value for `end` in ICalEvent #' + data.id + ' given!';
}
// DATE & TIME
g += 'BEGIN:VEVENT\r\n';
......@@ -572,10 +569,14 @@ var ICalEvent = function(_data) {
g += 'DTSTAMP:' + tools.formatDate(data.stamp) + '\r\n';
if(data.allDay) {
g += 'DTSTART;VALUE=DATE:' + tools.formatDate(data.start, true) + '\r\n';
g += 'DTEND;VALUE=DATE:' + tools.formatDate(data.end, true) + '\r\n';
if (data.end) {
g += 'DTEND;VALUE=DATE:' + tools.formatDate(data.end, true) + '\r\n';
}
} else {
g += 'DTSTART:' + tools.formatDate(data.start, false, data.floating) + '\r\n';
g += 'DTEND:' + tools.formatDate(data.end, false, data.floating) + '\r\n';
if (data.end) {
g += 'DTEND:' + tools.formatDate(data.end, false, data.floating) + '\r\n';
}
}
// REPEATING
......
......@@ -264,11 +264,6 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
assert.throws(function() {
cal.save(file);
}, /`start`/);
e.start(new Date());
assert.throws(function() {
cal.save(file);
}, /`end`/);
});
});
......@@ -296,12 +291,6 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
/*jslint stupid: true */
cal.saveSync(file);
}, /`start`/);
e.start(new Date());
assert.throws(function() {
/*jslint stupid: true */
cal.saveSync(file);
}, /`end`/);
});
});
......
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