Skip to content

Commit

Permalink
ArrayDataSource: update sorting (#1117)
Browse files Browse the repository at this point in the history
SORT_LOCALE_STRING - compare items as strings, based on the current locale. It uses the locale, which can be changed using setlocale()
  • Loading branch information
tmatejicek committed May 3, 2024
1 parent 38c2920 commit 94cd8f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DataSource/ArrayDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit 94cd8f6

Please sign in to comment.