(fix) correctly handle "Day of the month" constraint

This commit is contained in:
Ludovic Marcotte
2017-08-29 11:06:36 -04:00
parent 7d190e537e
commit f3cf29ea1f

View File

@@ -2028,9 +2028,17 @@ RANGE(2);
occurence = [[self repeat3] intValue] + 1;
if (occurence > 5) // the first/second/third/fourth/fifth ..
occurence = -1; // the last ..
[theRule setSingleValue: [NSString stringWithFormat: @"%d%@",
occurence, day]
forKey: @"byday"];
// Day of the month (last, fourth, etc.)
if ([[self repeat4] intValue] == 7)
{
[theRule setSingleValue: [NSString stringWithFormat: @"%d",occurence]
forKey: @"bymonthday"];
}
else
[theRule setSingleValue: [NSString stringWithFormat: @"%d%@",
occurence, day]
forKey: @"byday"];
}
else
{