BYSETPOS is an array, not a number

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2019-10-16 14:28:41 +02:00
parent 09b13e5f52
commit 5066abb6eb
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
1 changed files with 6 additions and 6 deletions

View File

@ -435,9 +435,9 @@ function getRecurrenceComponentFromMonthlyRule(recurrenceRule, recurrenceCompone
recurrenceComponent.isUnsupported = true
}
// TODO - BYSETPOS is an array, we only allow one value
if (isAllowedBySetPos(recurrenceRule.getComponent('BYSETPOS'))) {
recurrenceComponent.bySetPosition = recurrenceRule.getComponent('BYSETPOS')
const setPositionArray = recurrenceRule.getComponent('BYSETPOS')
if (setPositionArray.length === 1 && isAllowedBySetPos(setPositionArray[0])) {
recurrenceComponent.bySetPosition = setPositionArray[0]
} else {
recurrenceComponent.bySetPosition = 1
recurrenceComponent.isUnsupported = true
@ -527,9 +527,9 @@ function getRecurrenceComponentFromYearlyRule(recurrenceRule, recurrenceComponen
recurrenceComponent.isUnsupported = true
}
// TODO - BYSETPOS is an array, we only allow one value
if (isAllowedBySetPos(recurrenceRule.getComponent('BYSETPOS'))) {
recurrenceComponent.bySetPosition = recurrenceRule.getComponent('BYSETPOS')
const setPositionArray = recurrenceRule.getComponent('BYSETPOS')
if (setPositionArray.length === 1 && isAllowedBySetPos(setPositionArray[0])) {
recurrenceComponent.bySetPosition = setPositionArray[0]
} else {
recurrenceComponent.bySetPosition = 1
recurrenceComponent.isUnsupported = true