I am working on a wait times API to show the current queuing times of the Disney-parks. The wait times are loaded in a table in alphabetical order.
Now I have used the following code to sort this table on highest waits on top of the table to the lowest waits. That is what I want:
$(document).ready(function(){
var sorted = $('#mytable tbody tr').sort(function(b, a) {
var a = $(a).find('td:last').text(), b = $(b).find('td:last').text();
return a.localeCompare(b, false, {numeric: true})
})
$('#mytable tbody').html(sorted)
});
This works great, BUT as you can see in the image below the text values like 'Closed' and 'Refurbishment' are on top of the table, above the highest wait time.
How can I change this order of the table to get the highest wait times on top of the table and at last the text-values?
Current order, want to change this
So I want to get:
20 min.
15 min.
5 min.
Open
Closed
Refurbishment