mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-29 03:12:39 +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
|
// ID must exist on the object in order for the model to update the record and not to perform
|
||||||
// an insert operation.
|
// an insert operation.
|
||||||
|
|
||||||
var startDatetime = $dialog.find('#start-datetime')
|
var startDatetime = Date.parse($dialog.find('#start-datetime').val()).toString('yyyy-MM-dd HH:mm:ss');
|
||||||
.datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss');
|
var endDatetime = Date.parse($dialog.find('#end-datetime').val()).toString('yyyy-MM-dd HH:mm:ss');
|
||||||
var endDatetime = $dialog.find('#end-datetime')
|
|
||||||
.datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss');
|
|
||||||
|
|
||||||
var appointment = {
|
var appointment = {
|
||||||
id_services: $dialog.find('#select-service').val(),
|
id_services: $dialog.find('#select-service').val(),
|
||||||
|
@ -483,8 +481,8 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check appointment start and end time.
|
// Check appointment start and end time.
|
||||||
var start = $('#start-datetime').datepicker('getDate');
|
var start = Date.parse($('#start-datetime').val());
|
||||||
var end = $('#end-datetime').datepicker('getDate');
|
var end = Date.parse($('#end-datetime').val());
|
||||||
if (start > end) {
|
if (start > end) {
|
||||||
$dialog.find('#start-datetime').parents('.form-group').addClass('has-error');
|
$dialog.find('#start-datetime').parents('.form-group').addClass('has-error');
|
||||||
$dialog.find('#end-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() {
|
$('#manage-unavailable #save-unavailable').click(function() {
|
||||||
var $dialog = $('#manage-unavailable');
|
var $dialog = $('#manage-unavailable');
|
||||||
var start = $dialog.find('#unavailable-start').datetimepicker('getDate');
|
var start = Date.parse($dialog.find('#unavailable-start').val());
|
||||||
var end = $dialog.find('#unavailable-end').datetimepicker('getDate');
|
var end = Date.parse($dialog.find('#unavailable-end').val());
|
||||||
|
|
||||||
if (start > end) {
|
if (start > end) {
|
||||||
// Start time is after end time - display message to user.
|
// Start time is after end time - display message to user.
|
||||||
|
|
Loading…
Reference in a new issue