mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-25 09:23:08 +03:00
Do not use the "getDate" method of the datepicker as it changes the timezone for dates between the 30nth of October and the 25th of March.
This commit is contained in:
parent
e6082ab2e0
commit
81b3eb9bd3
2 changed files with 6 additions and 8 deletions
|
@ -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');
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue