mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 14:42:23 +03:00
Merge branch 'enddatetime-according-to-start-and-service' of https://github.com/Caine85/easyappointments into Caine85-enddatetime-according-to-start-and-service
# Conflicts: # src/assets/js/backend_calendar_appointments_modal.js
This commit is contained in:
commit
6b86d357ef
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