fix: ignore invalid pickup dates/times when sorting
This commit is contained in:
1 parent
c065fc6d86
commit
39f549e713
1 file changed
+4
@@ -477,6 +477,10 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
usort($pickups, function ($a, $b) {
|
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();
|
$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();
|
$timeStampB = \DateTimeImmutable::createFromFormat('d.m.Y H:i', $b['date'].' '.$b['time'])->getTimestamp();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user