diff --git a/resources/views/components/tomselect.blade.php b/resources/views/components/tomselect.blade.php index 9b71f2b..3ef7d93 100644 --- a/resources/views/components/tomselect.blade.php +++ b/resources/views/components/tomselect.blade.php @@ -22,7 +22,9 @@ field: 'text', direction: 'asc', func: function(a, b) { - return a.text.localeCompare(b.text, undefined, {numeric: true, sensitivity: 'base'}); + const a_val = a.text.split(' - ')[0]; + const b_val = b.text.split(' - ')[0]; + return parseInt(a_val, 10) - parseInt(b_val, 10); } }] });