Commit 81b9dea8 authored by Peter Jaszkowiak's avatar Peter Jaszkowiak
Browse files

Add BYDAY to repeating

parent 4b858afa
......@@ -224,6 +224,14 @@ var ICalEvent = function(_data) {
data.repeating.until = repeating.until;
}
if(repeating.byday){
if(!Array.isArray(repeating.byday)){
throw '`repeating.byday` must be an Array of day symbols!';
}
data.repeating.byday = repeating.byday;
}
return this;
};
......@@ -521,6 +529,10 @@ var ICalEvent = function(_data) {
if(data.repeating.until) {
g += ';UNTIL=' + tools.formatDate(data.repeating.until);
}
if(data.repeating.byday) {
g += ';BYDAY=' + data.repeating.byday.join(",");
}
g += '\r\n';
}
......@@ -578,4 +590,4 @@ var ICalEvent = function(_data) {
}
};
module.exports = ICalEvent;
\ No newline at end of file
module.exports = ICalEvent;
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