From 43b9cf678bc37d3eb711d4898076f50cd5634332 Mon Sep 17 00:00:00 2001 From: alext Date: Thu, 8 Mar 2018 14:59:13 +0100 Subject: [PATCH] Corrected time format use in booking page. --- src/assets/js/frontend_book_api.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/assets/js/frontend_book_api.js b/src/assets/js/frontend_book_api.js index 341c25d7..739546ad 100755 --- a/src/assets/js/frontend_book_api.js +++ b/src/assets/js/frontend_book_api.js @@ -71,6 +71,8 @@ window.FrontendBookApi = window.FrontendBookApi || {}; var currColumn = 1; $('#available-hours').html('
'); + var timeFormat = GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm'; + $.each(response, function (index, availableHour) { if ((currColumn * 10) < (index + 1)) { currColumn++; @@ -78,7 +80,7 @@ window.FrontendBookApi = window.FrontendBookApi || {}; } $('#available-hours div:eq(' + (currColumn - 1) + ')').append( - '' + Date.parse(availableHour).toString(GlobalVariables.timeFormat) + '
'); + '' + Date.parse(availableHour).toString(timeFormat) + '
'); }); if (FrontendBook.manageMode) { @@ -87,7 +89,7 @@ window.FrontendBookApi = window.FrontendBookApi || {}; $('.available-hour').filter(function () { return $(this).text() === Date.parseExact( GlobalVariables.appointmentData.start_datetime, - 'yyyy-MM-dd HH:mm:ss').toString(GlobalVariables.timeFormat); + 'yyyy-MM-dd HH:mm:ss').toString(timeFormat); }).addClass('selected-hour'); } else { // Set the first available hour as the default selection.