Use rawDate for list item sorting
This commit is contained in:
parent
a1344ca407
commit
f6f6c4ede6
1 changed files with 2 additions and 2 deletions
|
|
@ -80,9 +80,9 @@ function buildListItems(string $dir, Context $ctx, ?array $parentMetadata): arra
|
||||||
|
|
||||||
$sortOrder = strtolower($parentMetadata['order'] ?? 'descending');
|
$sortOrder = strtolower($parentMetadata['order'] ?? 'descending');
|
||||||
if ($sortOrder === 'ascending') {
|
if ($sortOrder === 'ascending') {
|
||||||
usort($items, fn($a, $b) => strcmp($a['date'] ?? '', $b['date'] ?? ''));
|
usort($items, fn($a, $b) => strcmp($a['rawDate'] ?? '', $b['rawDate'] ?? ''));
|
||||||
} else {
|
} else {
|
||||||
usort($items, fn($a, $b) => strcmp($b['date'] ?? '', $a['date'] ?? ''));
|
usort($items, fn($a, $b) => strcmp($b['rawDate'] ?? '', $a['rawDate'] ?? ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue