Further formatting corrections.

This commit is contained in:
alext 2018-03-17 18:00:55 +01:00
parent 52be9ff9d7
commit 610f184aad
5 changed files with 15 additions and 15 deletions

View File

@ -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,

View File

@ -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);

View File

@ -686,7 +686,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$event.html(
appointment.customer.first_name.charAt(0) + '. ' + appointment.customer.last_name +
' <span class="hour">' + startDate.toString(GlobalVariables.timeFormat) + '</span> '
' <span class="hour">' + startDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') + '</span> '
+ (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 = $('<div class="event unavailability" />');
$event.html((unavailability.notes || EALang.unavailable) +
' <span class="hour">' + eventDate.toString(GlobalVariables.timeFormat) + '</span> (' + eventDuration + '\')');
' <span class="hour">' + eventDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') + '</span> (' + 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 +
' <span class="hour">' + eventDate.toString(GlobalVariables.timeFormat) + '</span> (' + eventDuration + '\')');
' <span class="hour">' + eventDate.toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm') + '</span> (' + 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();
}

View File

@ -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,

View File

@ -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'));
}
}
});