mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-20 07:34:53 +00:00
(web) Fix "last day of the month" repeat rule
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user