diff --git a/src/assets/js/backend_calendar_appointments_modal.js b/src/assets/js/backend_calendar_appointments_modal.js index da81e650..d479415c 100644 --- a/src/assets/js/backend_calendar_appointments_modal.js +++ b/src/assets/js/backend_calendar_appointments_modal.js @@ -49,10 +49,8 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa // ID must exist on the object in order for the model to update the record and not to perform // an insert operation. - var startDatetime = $dialog.find('#start-datetime') - .datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss'); - var endDatetime = $dialog.find('#end-datetime') - .datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss'); + var startDatetime = Date.parse($dialog.find('#start-datetime').val()).toString('yyyy-MM-dd HH:mm:ss'); + var endDatetime = Date.parse($dialog.find('#end-datetime').val()).toString('yyyy-MM-dd HH:mm:ss'); var appointment = { id_services: $dialog.find('#select-service').val(), @@ -483,8 +481,8 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa } // Check appointment start and end time. - var start = $('#start-datetime').datepicker('getDate'); - var end = $('#end-datetime').datepicker('getDate'); + var start = Date.parse($('#start-datetime').val()); + var end = Date.parse($('#end-datetime').val()); if (start > end) { $dialog.find('#start-datetime').parents('.form-group').addClass('has-error'); $dialog.find('#end-datetime').parents('.form-group').addClass('has-error'); diff --git a/src/assets/js/backend_calendar_unavailabilities_modal.js b/src/assets/js/backend_calendar_unavailabilities_modal.js index 6c992980..127caf3c 100644 --- a/src/assets/js/backend_calendar_unavailabilities_modal.js +++ b/src/assets/js/backend_calendar_unavailabilities_modal.js @@ -30,8 +30,8 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili */ $('#manage-unavailable #save-unavailable').click(function() { var $dialog = $('#manage-unavailable'); - var start = $dialog.find('#unavailable-start').datetimepicker('getDate'); - var end = $dialog.find('#unavailable-end').datetimepicker('getDate'); + var start = Date.parse($dialog.find('#unavailable-start').val()); + var end = Date.parse($dialog.find('#unavailable-end').val()); if (start > end) { // Start time is after end time - display message to user.