From 94cd8f62d3a2fae4970d0f950141b4ef4dd05a9e Mon Sep 17 00:00:00 2001 From: T Date: Fri, 3 May 2024 21:38:25 +0200 Subject: [PATCH] ArrayDataSource: update sorting (#1117) SORT_LOCALE_STRING - compare items as strings, based on the current locale. It uses the locale, which can be changed using setlocale() --- src/DataSource/ArrayDataSource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DataSource/ArrayDataSource.php b/src/DataSource/ArrayDataSource.php index b92a60cc..2c77935f 100644 --- a/src/DataSource/ArrayDataSource.php +++ b/src/DataSource/ArrayDataSource.php @@ -124,9 +124,9 @@ public function sort(Sorting $sorting): IDataSource } if ($order === 'ASC') { - ksort($data); + ksort($data, SORT_LOCALE_STRING); } else { - krsort($data); + krsort($data, SORT_LOCALE_STRING); } $dataSource = [];