mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
Calendar: More checks to avoid 0 duration events
This commit is contained in:
parent
151889b39c
commit
2dc457c007
@ -359,6 +359,11 @@ class calendar_uiforms extends calendar_ui
|
||||
unset($content['alarm'][$id]);
|
||||
}
|
||||
}
|
||||
if($content['end'] && $content['start'] >= $content['end'])
|
||||
{
|
||||
unset($content['end']);
|
||||
$content['duration'] = $this->bo->cal_prefs['defaultlength']*60;
|
||||
}
|
||||
if ($content['duration'])
|
||||
{
|
||||
$content['end'] = $content['start'] + $content['duration'];
|
||||
|
@ -1287,6 +1287,14 @@ var CalendarApp = /** @class */ (function (_super) {
|
||||
if (recur_end && recur_end.getValue && !recur_end.getValue()) {
|
||||
recur_end.set_min(widget.getValue());
|
||||
}
|
||||
// Update end date, min duration is 1 minute
|
||||
var end = widget.getRoot().getDOMWidgetById('end');
|
||||
var start_time = new Date(widget.getValue());
|
||||
var end_time = new Date(end.getValue());
|
||||
if (end_time <= start_time) {
|
||||
start_time.setMinutes(start_time.getMinutes() + 1);
|
||||
end.set_value(start_time);
|
||||
}
|
||||
}
|
||||
// Update currently selected alarm time
|
||||
this.alarm_custom_date();
|
||||
|
@ -1347,9 +1347,20 @@ class CalendarApp extends EgwApp
|
||||
{
|
||||
recur_end.set_min(widget.getValue());
|
||||
}
|
||||
|
||||
// Update end date, min duration is 1 minute
|
||||
let end = <et2_date> widget.getRoot().getDOMWidgetById('end');
|
||||
let start_time = new Date(widget.getValue());
|
||||
let end_time = new Date(end.getValue());
|
||||
if(end_time <= start_time)
|
||||
{
|
||||
start_time.setMinutes(start_time.getMinutes() + 1);
|
||||
end.set_value(start_time);
|
||||
}
|
||||
}
|
||||
// Update currently selected alarm time
|
||||
this.alarm_custom_date();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user