From 5dd8540577cf72eae5592e2286bb51f2b747ef0f Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 19 Jul 2021 17:44:31 +0300 Subject: [PATCH] Use the AM/PM postfix as lowercase everywhere for consistency. --- assets/js/working_plan.js | 32 ++++++++++++++++---------------- engine/Notifications/Email.php | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/assets/js/working_plan.js b/assets/js/working_plan.js index 99bd9309..4c7db0a3 100755 --- a/assets/js/working_plan.js +++ b/assets/js/working_plan.js @@ -85,7 +85,7 @@ 'html': [ $('', { 'id': index + '-start', - 'class': 'work-start form-control input-sm' + 'class': 'work-start form-control form-control-sm' }) ] }), @@ -93,7 +93,7 @@ 'html': [ $('', { 'id': index + '-end', - 'class': 'work-start form-control input-sm' + 'class': 'work-start form-control form-control-sm' }) ] }) @@ -103,8 +103,8 @@ if (workingDay) { $('#' + index).prop('checked', true); - $('#' + index + '-start').val(Date.parse(workingDay.start).toString(timeFormat).toUpperCase()); - $('#' + index + '-end').val(Date.parse(workingDay.end).toString(timeFormat).toUpperCase()); + $('#' + index + '-start').val(Date.parse(workingDay.start).toString(timeFormat).toLowerCase()); + $('#' + index + '-end').val(Date.parse(workingDay.end).toString(timeFormat).toLowerCase()); // Sort day's breaks according to the starting hour workingDay.breaks.sort(function (break1, break2) { @@ -121,11 +121,11 @@ }), $('', { 'class': 'break-start editable', - 'text': Date.parse(workingDayBreak.start).toString(timeFormat).toUpperCase() + 'text': Date.parse(workingDayBreak.start).toString(timeFormat).toLowerCase() }), $('', { 'class': 'break-end editable', - 'text': Date.parse(workingDayBreak.end).toString(timeFormat).toUpperCase() + 'text': Date.parse(workingDayBreak.end).toString(timeFormat).toLowerCase() }), $('', { 'html': [ @@ -307,11 +307,11 @@ }), $('', { 'class': 'working-plan-exception--start', - 'text': Date.parse(workingPlanException.start).toString(timeFormat) + 'text': Date.parse(workingPlanException.start).toString(timeFormat).toLowerCase() }), $('', { 'class': 'working-plan-exception--end', - 'text': Date.parse(workingPlanException.end).toString(timeFormat) + 'text': Date.parse(workingPlanException.end).toString(timeFormat).toLowerCase() }), $('', { 'html': [ @@ -379,11 +379,11 @@ }), $('', { 'class': 'break-start editable', - 'text': Date.parse('12:00:00').toString(timeFormat) + 'text': Date.parse('12:00:00').toString(timeFormat).toLowerCase() }), $('', { 'class': 'break-end editable', - 'text': Date.parse('14:00:00').toString(timeFormat) + 'text': Date.parse('14:00:00').toString(timeFormat).toLowerCase() }), $('', { 'html': [ @@ -457,7 +457,7 @@ // Make all cells in current row editable. $(this).parent().parent().children().trigger('edit'); $(this).parent().parent().find('.break-start input, .break-end input').timepicker({ - timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm TT' : 'HH:mm', + timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm', currentText: EALang.now, closeText: EALang.close, timeOnlyTitle: EALang.select_time, @@ -471,7 +471,7 @@ var $tr = $(this).closest('tr'); $tr.find('.edit-break, .delete-break').addClass('d-none'); $tr.find('.save-break, .cancel-break').removeClass('d-none'); - $tr.find('select,input:text').addClass('form-control input-sm') + $tr.find('select,input:text').addClass('form-control form-control-sm') }); /** @@ -497,7 +497,7 @@ $modifiedRow.find('.cancel-editable').trigger('click'); this.enableCancel = false; - $(element).closest('table').find('.edit-break, .delete-break').removeClass('d-none'); + $modifiedRow.find('.edit-break, .delete-break').removeClass('d-none'); $modifiedRow.find('.save-break, .cancel-break').addClass('d-none'); }.bind(this)); @@ -516,7 +516,7 @@ var end = Date.parse($modifiedRow.find('.break-end input').val()); if (start > end) { - $modifiedRow.find('.break-end input').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm')); + $modifiedRow.find('.break-end input').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toLowerCase()); } this.enableSubmit = true; @@ -658,7 +658,7 @@ if (disabled === false) { // Set timepickers where needed. $('.working-plan input:text').timepicker({ - timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm TT' : 'HH:mm', + timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm', currentText: EALang.now, closeText: EALang.close, timeOnlyTitle: EALang.select_time, @@ -672,7 +672,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' : 'HH:mm')); + $(this).parent().parent().find('.work-end').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toLowerCase()); } } }); diff --git a/engine/Notifications/Email.php b/engine/Notifications/Email.php index 9e607d38..24617230 100755 --- a/engine/Notifications/Email.php +++ b/engine/Notifications/Email.php @@ -119,7 +119,7 @@ class Email { $time_format = 'H:i'; break; case 'regular': - $time_format = 'g:i A'; + $time_format = 'g:i a'; break; default: throw new Exception('Invalid time_format value: ' . $settings['time_format']); @@ -223,7 +223,7 @@ class Email { $time_format = 'H:i'; break; case 'regular': - $time_format = 'g:i A'; + $time_format = 'g:i a'; break; default: throw new Exception('Invalid time_format value: ' . $settings['time_format']);