Until date of repeat must end after first event
parent
ce5cc6843e
commit
07c66563e8
2
NEWS
2
NEWS
|
@ -5,7 +5,7 @@ New features
|
|||
-
|
||||
|
||||
Enhancements
|
||||
-
|
||||
- [web] don't allow a recurrence rule to end before the first occurrence
|
||||
|
||||
Bug fixes
|
||||
- [eas] properly generate the BusyStatus for normal events
|
||||
|
|
|
@ -379,6 +379,8 @@ validate_notitle = "No title is set, continue?";
|
|||
validate_invalid_startdate = "Incorrect startdate field!";
|
||||
validate_invalid_enddate = "Incorrect enddate field!";
|
||||
validate_endbeforestart = "The end date that you entered occurs before the start date.";
|
||||
validate_untilbeforeend = "The recurrence must end after the first occurrence.";
|
||||
|
||||
"Events" = "Events";
|
||||
"Tasks" = "Tasks";
|
||||
"Show completed tasks" = "Show completed tasks";
|
||||
|
|
|
@ -187,17 +187,19 @@
|
|||
}
|
||||
*/
|
||||
|
||||
- (void) _adjustRecurrentRules
|
||||
- (NSException *) _adjustRecurrentRules
|
||||
{
|
||||
iCalEvent *event;
|
||||
iCalRecurrenceRule *rule;
|
||||
NSEnumerator *rules;
|
||||
NSException *ex;
|
||||
NSCalendarDate *untilDate;
|
||||
SOGoUserDefaults *ud;
|
||||
NSTimeZone *timeZone;
|
||||
|
||||
event = [self event];
|
||||
rules = [[event recurrenceRules] objectEnumerator];
|
||||
ex = nil;
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
|
||||
|
@ -205,6 +207,14 @@
|
|||
{
|
||||
untilDate = [rule untilDate];
|
||||
if (untilDate)
|
||||
{
|
||||
if ([untilDate compare: [event endDate]] == NSOrderedAscending)
|
||||
{
|
||||
ex = [NSException exceptionWithHTTPStatus: 500
|
||||
reason: [self labelForKey: @"validate_untilbeforeend"]];
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The until date must match the time of the end date
|
||||
NSCalendarDate *date;
|
||||
|
@ -222,6 +232,9 @@
|
|||
[date release];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -481,8 +494,10 @@
|
|||
forceSave = [[params objectForKey: @"ignoreConflicts"] boolValue];
|
||||
|
||||
if ([event hasRecurrenceRules])
|
||||
[self _adjustRecurrentRules];
|
||||
ex = [self _adjustRecurrentRules];
|
||||
|
||||
if (!ex)
|
||||
{
|
||||
if ([co isNew])
|
||||
{
|
||||
if (componentCalendar
|
||||
|
@ -526,6 +541,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ex)
|
||||
{
|
||||
|
|
|
@ -214,9 +214,15 @@
|
|||
<label><var:string label:value="times"/></label>
|
||||
<input type="number" label:aria-label="times" ng-model="editor.component.repeat.count"/>
|
||||
</md-input-container>
|
||||
<md-datepicker ng-show="editor.component.repeat.end == 'until'"
|
||||
<md-input-container ng-show="editor.component.repeat.end == 'until'">
|
||||
<md-datepicker name="repeat_until"
|
||||
ng-model="editor.component.repeat.until"
|
||||
md-min-date="editor.component.end"
|
||||
label:md-placeholder="On Date"><!-- date picker --></md-datepicker>
|
||||
<div ng-messages="eventForm.repeat_until.$error">
|
||||
<div ng-message="mindate"><var:string label:value="validate_untilbeforeend"/></div>
|
||||
</div>
|
||||
</md-input-container>
|
||||
</div>
|
||||
</div>
|
||||
<!-- attendees -->
|
||||
|
@ -296,7 +302,7 @@
|
|||
<var:string label:value="Reset"/>
|
||||
</md-button>
|
||||
<md-button class="md-primary" type="submit"
|
||||
ng-disabled="editor.eventForm.$invalid">
|
||||
ng-disabled="eventForm.$invalid">
|
||||
<var:string label:value="Save"/>
|
||||
</md-button>
|
||||
</md-dialog-actions>
|
||||
|
|
Loading…
Reference in New Issue