mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 22:52:35 +03:00
Corrected time format use in booking page.
This commit is contained in:
parent
632f7539eb
commit
43b9cf678b
1 changed files with 4 additions and 2 deletions
|
@ -71,6 +71,8 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
var currColumn = 1;
|
||||
$('#available-hours').html('<div style="width:80px; float:left;"></div>');
|
||||
|
||||
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(
|
||||
'<span class="available-hour">' + Date.parse(availableHour).toString(GlobalVariables.timeFormat) + '</span><br/>');
|
||||
'<span class="available-hour">' + Date.parse(availableHour).toString(timeFormat) + '</span><br/>');
|
||||
});
|
||||
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue