fix: ignore invalid pickup dates/times when sorting
This commit is contained in:
@@ -477,6 +477,10 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
];
|
||||
}
|
||||
usort($pickups, function ($a, $b) {
|
||||
if (empty($a['date']) || empty($b['date']) || empty($a['time']) || empty($b['time'])) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$timeStampA = \DateTimeImmutable::createFromFormat('d.m.Y H:i', $a['date'].' '.$a['time'])->getTimestamp();
|
||||
$timeStampB = \DateTimeImmutable::createFromFormat('d.m.Y H:i', $b['date'].' '.$b['time'])->getTimestamp();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user