diff --git a/Services/Skill/Table/classes/trait.TableRecords.php b/Services/Skill/Table/classes/trait.TableRecords.php index 42f71b911b04..8b64bb561c46 100644 --- a/Services/Skill/Table/classes/trait.TableRecords.php +++ b/Services/Skill/Table/classes/trait.TableRecords.php @@ -21,6 +21,7 @@ namespace ILIAS\Skill\Table; use ILIAS\Data; +use ILIAS\UI\Component\Link\Link; /** * Wrapper for sortation and pagination of table records @@ -49,9 +50,12 @@ protected function orderRecords(array $records, Data\Order $order): array if (is_array($a[$aspect])) { return $a[$aspect] <=> $b[$aspect]; } - if ($a[$aspect] instanceof \ILIAS\UI\Component\Link\Link) { + if ($a[$aspect] instanceof Link) { return $a[$aspect]->getLabel() <=> $b[$aspect]->getLabel(); } + if ($a[$aspect] instanceof \DateTimeImmutable) { + return $a[$aspect]->getTimestamp() <=> $b[$aspect]->getTimestamp(); + } return strcmp($a[$aspect], $b[$aspect]); }); @@ -59,7 +63,6 @@ protected function orderRecords(array $records, Data\Order $order): array if ($direction === $order::DESC) { $records = array_reverse($records); } - return $records; }