Commit 8233807b authored by Sebastian's avatar Sebastian
Browse files

Code Style

parent dc9a8ad6
......@@ -30,16 +30,16 @@ module.exports.formatDate = function formatDate(d, dateonly, floating) {
// For information about this format, see RFC 5545, section 3.3.5
// https://tools.ietf.org/html/rfc5545#section-3.3.5
module.exports.formatDateTZ = function formatDateTZ(property, date, eventData) {
var tzParam = '';
var floating = eventData.floating;
var tzParam = '';
var floating = eventData.floating;
if(eventData.timezone) {
tzParam = ';TZID=' + eventData.timezone;
if(eventData.timezone) {
tzParam = ';TZID=' + eventData.timezone;
// This isn't a 'floating' event because it has a timezone;
// but we use it to omit the 'Z' UTC specifier in formatDate()
floating = true;
}
// This isn't a 'floating' event because it has a timezone;
// but we use it to omit the 'Z' UTC specifier in formatDate()
floating = true;
}
return property + tzParam + ':' + module.exports.formatDate(date, false, floating);
};
......
......@@ -612,12 +612,12 @@ 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';
if (data.end) {
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 += tools.formatDateTZ('DTSTART', data.start, data) + '\r\n';
if (data.end) {
if(data.end) {
g += tools.formatDateTZ('DTEND', data.end, data) + '\r\n';
}
}
......
......@@ -232,7 +232,7 @@ describe('ical-generator 0.2.x / ICalCalendar', function() {
});
it('should not require optional parameters', function() {
assert.doesNotThrow(function () {
assert.doesNotThrow(function() {
ical().addEvent({
start: new Date(),
summary: 'Patch-Day'
......
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