From 0e7d8fe599a8898bbc0ff585025795df15a79a6c Mon Sep 17 00:00:00 2001 From: Ed Leckert Date: Wed, 18 Oct 2023 10:08:28 -0600 Subject: [PATCH] fix-sort-order-for-special-chars --- flex-table-card.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flex-table-card.js b/flex-table-card.js index 1c339a8..335e2fb 100644 --- a/flex-table-card.js +++ b/flex-table-card.js @@ -19,9 +19,9 @@ var compare = function(a, b) { var b1 = b.split('.').reduce(function(ipInt, octet) { return (ipInt<<8) + parseInt(octet, 10)}, 0) >>> 0; return (a1 - b1); } else if (isNaN(a)) - return a.toString().localeCompare(b); + return a.toString().localeCompare(b, navigator.language); else if (isNaN(b)) - return -1 * b.toString().localeCompare(a); + return -1 * b.toString().localeCompare(a, navigator.language); else return parseFloat(a) - parseFloat(b); }