From 6b1addce9f1b39d0722fbc74e46ab8965cd67340 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 14 Nov 2014 09:37:49 +0000 Subject: [PATCH] Preset enddate accroding to start date of an event, plus considering duration if it exists --- calendar/js/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/calendar/js/app.js b/calendar/js/app.js index 914ea2d76d..9c596cbb90 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -780,10 +780,18 @@ app.classes.calendar = AppJS.extend( set_enddate_visibility: function() { var duration = this.et2.getWidgetById('duration'); + var start = this.et2.getWidgetById('start'); var end = this.et2.getWidgetById('end'); + var content = this.et2.getArrayMgr('content').data; + if (typeof duration != 'undefined' && typeof end != 'undefined') { end.set_disabled(duration.get_value()!==''); + if (!end.disabled ) + { + end.set_value(start.get_value()); + if (typeof content.duration != 'undefined') end.set_value("+"+content.duration); + } } },