fix: use numeric timestamps to sort pickup dates and times
This commit is contained in:
@@ -477,8 +477,8 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
usort($pickups, function ($a, $b) {
|
usort($pickups, function ($a, $b) {
|
||||||
$timeStampA = \DateTimeImmutable::createFromFormat('d.m.Y H:i', $a['date'].' '.$a['time']);
|
$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']);
|
$timeStampB = \DateTimeImmutable::createFromFormat('d.m.Y H:i', $b['date'].' '.$b['time'])->getTimestamp();
|
||||||
|
|
||||||
return $timeStampA <=> $timeStampB;
|
return $timeStampA <=> $timeStampB;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user