diff --git a/calendar/js/app.js b/calendar/js/app.js index 4eb5453450..9b0eb7fead 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -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'); } @@ -1033,6 +1034,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. diff --git a/calendar/templates/default/edit.xet b/calendar/templates/default/edit.xet index d8622cfb17..ae6fa163d4 100644 --- a/calendar/templates/default/edit.xet +++ b/calendar/templates/default/edit.xet @@ -208,7 +208,7 @@ - +