Limit event edit dialog's recurrence end date to after the event start date

This commit is contained in:
nathangray 2016-07-25 16:14:13 -06:00
parent acbf2b46da
commit 76c537b63a
2 changed files with 28 additions and 1 deletions

View File

@ -211,6 +211,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
{
this.set_enddate_visibility();
this.check_recur_type();
this.edit_start_change();
this.et2.getWidgetById('recur_exception').set_disabled(!content.data.recur_exception ||
typeof content.data.recur_exception[0] == 'undefined');
}
@ -1035,6 +1036,32 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
}
},
/**
* Actions for when the user changes the event start date in edit dialog
*
* @returns {undefined}
*/
edit_start_change: function(input, widget)
{
if(!widget)
{
widget = etemplate2.getById('calendar-edit').widgetContainer.getWidgetById('start');
}
// Update settings for querying participants
this.edit_update_participant(widget);
// Update recurring date limit, if not set it can't be before start
if(widget)
{
var recur_end = widget.getRoot().getWidgetById('recur_enddate');
if(recur_end && !recur_end.getValue())
{
recur_end.set_min(widget.getValue());
}
}
},
/**
* Show/Hide end date, for both edit and freetimesearch popups,
* based on if "use end date" selected or not.

View File

@ -208,7 +208,7 @@
</row>
<row class="dialogHeader2" height="28">
<description for="start" value="Start" width="88"/>
<date-time id="start" needed="1" class="required" onchange="app.calendar.edit_update_participant"/>
<date-time id="start" needed="1" class="required" onchange="app.calendar.edit_start_change"/>
<description for="duration" value="Duration" id="calendar_edit_duration" />
<menulist>
<menupopup statustext="Duration of the meeting" class="et2_fullWidth" id="duration" no_lang="1" onchange="app.calendar.set_enddate_visibility" options="Use end date,,,,,,,false"/>