mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-27 00:52:56 +03:00
Merge branch 'Caine85-enddatetime-according-to-start-and-service' into develop
This commit is contained in:
commit
07e354d332
1 changed files with 14 additions and 2 deletions
|
@ -427,7 +427,19 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
timeText: EALang.time,
|
||||
hourText: EALang.hour,
|
||||
minuteText: EALang.minutes,
|
||||
firstDay: fDaynum
|
||||
firstDay: fDaynum,
|
||||
onClose: function () {
|
||||
var sid = $('#select-service').val();
|
||||
|
||||
// Automatically update the #end-datetime DateTimePicker based on service duration.
|
||||
$.each(GlobalVariables.availableServices, function (indexService, service) {
|
||||
if (service.id == sid) {
|
||||
var start = $('#start-datetime').datetimepicker('getDate');
|
||||
$('#end-datetime').datetimepicker('setDate', new Date(start.getTime() + service.duration * 60000));
|
||||
return false; // break loop
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$dialog.find('#start-datetime').datetimepicker('setDate', startDatetime);
|
||||
|
||||
|
@ -515,4 +527,4 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
_bindEventHandlers();
|
||||
};
|
||||
|
||||
})(window.BackendCalendarAppointmentsModal);
|
||||
})(window.BackendCalendarAppointmentsModal);
|
||||
|
|
Loading…
Reference in a new issue