Shift end time according to the current duration when changing start time (for convenience)
This commit is contained in:
parent
ad55fc706d
commit
26ef4c64f8
1 changed files with 11 additions and 1 deletions
|
@ -4032,7 +4032,7 @@ function rcube_calendar_ui(settings)
|
|||
open: autocomplete_open,
|
||||
change: event_times_changed,
|
||||
select: function(event, ui) {
|
||||
$(this).val(ui.item[0]);
|
||||
$(this).val(ui.item[0]).change();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
|
@ -4047,6 +4047,16 @@ function rcube_calendar_ui(settings)
|
|||
};
|
||||
});
|
||||
|
||||
// adjust end time when changing start
|
||||
$('#edit-starttime').change(function(e) {
|
||||
var dstart = $('#edit-startdate'),
|
||||
newstart = parse_datetime(this.value, dstart.val()),
|
||||
newend = new Date(newstart.getTime() + dstart.data('duration') * 1000);
|
||||
$('#edit-endtime').val($.fullCalendar.formatDate(newend, me.settings['time_format']));
|
||||
$('#edit-enddate').val($.fullCalendar.formatDate(newend, me.settings['date_format']));
|
||||
event_times_changed();
|
||||
});
|
||||
|
||||
// register events on alarms and recurrence fields
|
||||
me.init_alarms_edit('#edit-alarms');
|
||||
me.init_recurrence_edit('#eventedit');
|
||||
|
|
Loading…
Add table
Reference in a new issue