forked from TFMM/silent-auction
fix: revert to localeCompare numeric:true for natural sorting
This commit is contained in:
@@ -22,12 +22,7 @@
|
||||
field: 'text',
|
||||
direction: 'asc',
|
||||
func: function(a, b) {
|
||||
const valA = parseInt(a.text, 10);
|
||||
const valB = parseInt(b.text, 10);
|
||||
if (isNaN(valA) || isNaN(valB)) {
|
||||
return a.text.localeCompare(b.text);
|
||||
}
|
||||
return valA - valB;
|
||||
return a.text.localeCompare(b.text, undefined, {numeric: true, sensitivity: 'base'});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user