diff --git a/assets/js/utility/api-events.js b/assets/js/utility/api-events.js index 09398dabff..58796f9f2a 100644 --- a/assets/js/utility/api-events.js +++ b/assets/js/utility/api-events.js @@ -86,11 +86,11 @@ function filterDataFromApi(responseData) { * Sorts Filtered Date from the api end point by their start time */ function sortData(filteredData) { - for (const [key, value] of Object.entries(filteredData)) { - value.sort(function (a, b) { + Object.values(filteredData).forEach(value => { + value.sort((a, b) => { return convertTime12to24(a.start) - convertTime12to24(b.start) || a.name.localeCompare(b.name); }); - } + }); return filteredData; }