(web) Fix "last day of the month" repeat rule

This commit is contained in:
Francis Lachapelle
2017-08-29 14:29:11 -04:00
parent 5e5e52e3f1
commit 491e090fb4
3 changed files with 27 additions and 19 deletions
+1 -17
View File
@@ -145,22 +145,6 @@
return text;
}
- (NSString *) idForWeekDay
{
static NSArray *shortWeekDaysList = nil;
NSString *id;
if (!shortWeekDaysList)
{
shortWeekDaysList = [locale objectForKey: NSShortWeekDayNameArray];
[shortWeekDaysList retain];
}
id = [NSString stringWithFormat: @"weekDay%i", (int)[shortWeekDaysList indexOfObject: item]];
return id;
}
- (NSString *) labelForWeekDay
{
return item;
@@ -197,7 +181,7 @@
i = [[self monthlyDayList] indexOfObject: item];
if (i % 7 != i)
return @"";
return @"relative";
else
return iCalWeekDayString[i];
}
@@ -1171,7 +1171,7 @@
// Update recurrence definition depending on selections
if (this.hasCustomRepeat()) {
if (this.repeat.frequency == 'monthly' && this.repeat.month.type && this.repeat.month.type == 'byday' ||
if (this.repeat.frequency == 'monthly' && this.repeat.month.type && this.repeat.month.type == 'byday' && this.repeat.month.day != 'relative' ||
this.repeat.frequency == 'yearly' && this.repeat.year.byday) {
// BYDAY mask for a monthly or yearly recurrence
delete component.repeat.monthdays;
@@ -1181,6 +1181,8 @@
this.repeat.month.type) {
// montly recurrence by month days or yearly by month
delete component.repeat.days;
if (this.repeat.month.day == 'relative')
component.repeat.monthdays = [this.repeat.month.occurrence];
}
}
else if (this.repeat.frequency && this.repeat.frequency != 'never') {