From 610f184aadfe4a3dcbd485afbfbf947b94db529b Mon Sep 17 00:00:00 2001 From: alext Date: Sat, 17 Mar 2018 18:00:55 +0100 Subject: [PATCH] Further formatting corrections. --- src/assets/js/backend_calendar_appointments_modal.js | 4 ++-- src/assets/js/backend_calendar_default_view.js | 4 ++-- src/assets/js/backend_calendar_table_view.js | 12 ++++++------ .../js/backend_calendar_unavailabilities_modal.js | 4 ++-- src/assets/js/working_plan.js | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/assets/js/backend_calendar_appointments_modal.js b/src/assets/js/backend_calendar_appointments_modal.js index 6fbf2a5b..422f5cec 100755 --- a/src/assets/js/backend_calendar_appointments_modal.js +++ b/src/assets/js/backend_calendar_appointments_modal.js @@ -391,7 +391,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa $dialog.find('#start-datetime').datetimepicker({ dateFormat: dateFormat, - timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : GlobalVariables.timeFormat, + timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm TT' : 'HH:mm', // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, @@ -421,7 +421,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa $dialog.find('#end-datetime').datetimepicker({ dateFormat: dateFormat, - timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : GlobalVariables.timeFormat, + timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm TT' : 'HH:mm', // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, diff --git a/src/assets/js/backend_calendar_default_view.js b/src/assets/js/backend_calendar_default_view.js index f038ff42..1d81b9be 100755 --- a/src/assets/js/backend_calendar_default_view.js +++ b/src/assets/js/backend_calendar_default_view.js @@ -1072,8 +1072,8 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; slotTimeFormat = 'H(:mm)'; break; case 'regular': - timeFormat = 'h:mm A'; - slotTimeFormat = 'h(:mm) A'; + timeFormat = 'h:mm a'; + slotTimeFormat = 'h(:mm) a'; break; default: throw new Error('Invalid time format setting provided!', GlobalVariables.timeFormat); diff --git a/src/assets/js/backend_calendar_table_view.js b/src/assets/js/backend_calendar_table_view.js index 051b694f..d354de47 100755 --- a/src/assets/js/backend_calendar_table_view.js +++ b/src/assets/js/backend_calendar_table_view.js @@ -686,7 +686,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.html( appointment.customer.first_name.charAt(0) + '. ' + appointment.customer.last_name + - ' ' + startDate.toString(GlobalVariables.timeFormat) + ' ' + ' ' + startDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') + ' ' + (eventDuration !== parseInt(appointment.service.duration) ? '(' + eventDuration + '\')' : '') ); @@ -708,7 +708,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.appendTo($(tr).prev().find('td').eq(cellIndex)); // Remove the hour from the event if it is the same as the row. - if (eventDate.toString(GlobalVariables.timeFormat) === $(tr).prev().find('td').eq(0).text()) { + if (eventDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') === $(tr).prev().find('td').eq(0).text()) { $event.find('.hour').remove(); } @@ -747,7 +747,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; var $event = $('
'); $event.html((unavailability.notes || EALang.unavailable) + - ' ' + eventDate.toString(GlobalVariables.timeFormat) + ' (' + eventDuration + '\')'); + ' ' + eventDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') + ' (' + eventDuration + '\')'); $event.data(unavailability); @@ -763,7 +763,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.appendTo($(tr).prev().find('td').eq(1)); // Remove the hour from the event if it is the same as the row. - if (eventDate.toString(GlobalVariables.timeFormat) === $(tr).prev().find('td').eq(0).text()) { + if (eventDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') === $(tr).prev().find('td').eq(0).text()) { $event.find('.hour').remove(); } @@ -798,7 +798,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.html( EALang.break + - ' ' + eventDate.toString(GlobalVariables.timeFormat) + ' (' + eventDuration + '\')'); + ' ' + eventDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') + ' (' + eventDuration + '\')'); $event.data(entry); @@ -812,7 +812,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; if (eventDate < cellDate) { // Remove the hour from the event if it is the same as the row. - if (eventDate.toString(GlobalVariables.timeFormat) === $(tr).prev().find('td').eq(0).text()) { + if (eventDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') === $(tr).prev().find('td').eq(0).text()) { $event.find('.hour').remove(); } diff --git a/src/assets/js/backend_calendar_unavailabilities_modal.js b/src/assets/js/backend_calendar_unavailabilities_modal.js index 7c34024d..1c347e85 100755 --- a/src/assets/js/backend_calendar_unavailabilities_modal.js +++ b/src/assets/js/backend_calendar_unavailabilities_modal.js @@ -183,7 +183,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili $dialog.find('#unavailable-start').datetimepicker({ dateFormat: dateFormat, - timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : GlobalVariables.timeFormat, + timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm', // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, @@ -213,7 +213,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili $dialog.find('#unavailable-end').datetimepicker({ dateFormat: dateFormat, - timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : GlobalVariables.timeFormat, + timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm', // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, diff --git a/src/assets/js/working_plan.js b/src/assets/js/working_plan.js index b7530037..b27338b9 100755 --- a/src/assets/js/working_plan.js +++ b/src/assets/js/working_plan.js @@ -295,7 +295,7 @@ end = Date.parse($modifiedRow.find('.break-end input').val()); if (start > end) { - $modifiedRow.find('.break-end input').val(start.addHours(1).toString(GlobalVariables.timeFormat)); + $modifiedRow.find('.break-end input').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm')); } this.enableSubmit = true; @@ -361,7 +361,7 @@ if (disabled == false) { // Set timepickers where needed. $('.working-plan input:text').timepicker({ - timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : GlobalVariables.timeFormat, + timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm', currentText: EALang.now, closeText: EALang.close, timeOnlyTitle: EALang.select_time, @@ -375,7 +375,7 @@ end = Date.parse($(this).parent().parent().find('.work-end').val()); if (start > end) { - $(this).parent().parent().find('.work-end').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : GlobalVariables.timeFormat)); + $(this).parent().parent().find('.work-end').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm')); } } });