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
35de7133
Commit
35de7133
authored
May 12, 2016
by
Jen Huang
Browse files
add support for nth occurrence of weekdays
ex: 2MO (second Monday of month) ex: -1SU (last Sunday of month)
parent
525c1eeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/event.js
View file @
35de7133
...
...
@@ -309,12 +309,12 @@ var ICalEvent = function(_data, calendar) {
data
.
repeating
.
byDay
=
[];
repeating
.
byDay
.
forEach
(
function
(
symbol
)
{
var
s
=
symbol
.
toString
().
toUpperCase
();
if
([
'
SU
'
,
'
MO
'
,
'
TU
'
,
'
WE
'
,
'
TH
'
,
'
FR
'
,
'
SA
'
].
indexOf
(
s
)
===
-
1
)
{
throw
'
`repeating.byDay` contains invalid value `
'
+
s
+
'
`!
'
;
var
s
=
symbol
.
toString
().
toUpperCase
()
.
match
(
/^
(\d
*||-
\d
+
)(\w
+
)
$/
)
;
if
([
'
SU
'
,
'
MO
'
,
'
TU
'
,
'
WE
'
,
'
TH
'
,
'
FR
'
,
'
SA
'
].
indexOf
(
s
[
2
]
)
===
-
1
)
{
throw
'
`repeating.byDay` contains invalid value `
'
+
s
[
2
]
+
'
`!
'
;
}
data
.
repeating
.
byDay
.
push
(
s
);
data
.
repeating
.
byDay
.
push
(
s
[
1
]
+
s
[
2
]
);
});
}
...
...
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