Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
lib-ical
Commits
2289ef7a
Commit
2289ef7a
authored
Sep 03, 2016
by
Mark Stenglein
Browse files
Add support for excluded days in repeating events
parent
4cdb0c71
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/event.js
View file @
2289ef7a
...
@@ -346,6 +346,21 @@ var ICalEvent = function(_data, calendar) {
...
@@ -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
;
return
this
;
};
};
...
@@ -687,6 +702,13 @@ var ICalEvent = function(_data, calendar) {
...
@@ -687,6 +702,13 @@ var ICalEvent = function(_data, calendar) {
g
+=
'
;BYMONTHDAY=
'
+
data
.
repeating
.
byMonthDay
.
join
(
'
,
'
);
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
'
;
g
+=
'
\r\n
'
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment