fix: emit export pickup times as clock readings without an offset
This commit is contained in:
1 parent
6c700ea18b
commit
ede8fd840a
6 files changed
+136
-27
No files matched your search
@@ -144,8 +144,15 @@ class TravelExportBuilder
|
||||
// getPickups() is what buys stringToDateTimeFuzzy() for both zeit shapes and
|
||||
// adjustOvernightTimes(), which rolls an 02:15 listed after a 23:59 onto the next
|
||||
// calendar day. Resolved once per travel date, then shared by its hotel rows.
|
||||
//
|
||||
// Resolved in UTC: the times are BusPro's clock readings, and in Europe/Berlin a
|
||||
// bare 02:45 on the spring-forward night would move to 03:45.
|
||||
$pickups = $this->buildPickups(
|
||||
$this->travelParser->getPickups($node->filterXPath('.//zustiege/zustieg'), $dateFrom, true),
|
||||
$this->travelParser->getPickups(
|
||||
$node->filterXPath('.//zustiege/zustieg'),
|
||||
new \DateTimeImmutable($dateFrom->format('Y-m-d'), new \DateTimeZone('UTC')),
|
||||
true,
|
||||
),
|
||||
$pickupMasterData,
|
||||
$pickupsWithoutMasterData,
|
||||
);
|
||||
@@ -234,8 +241,9 @@ class TravelExportBuilder
|
||||
'street' => $details?->street,
|
||||
'time' => $pickup->time?->format('H:i'),
|
||||
// Emitted for time-only sources too: adjustOvernightTimes() has already
|
||||
// worked out the real day, and a null here would throw that away.
|
||||
'datetime' => $pickup->time?->format('c'),
|
||||
// worked out the real day, and a null here would throw that away. A clock
|
||||
// reading without an offset, like `time`.
|
||||
'datetime' => $pickup->time?->format('Y-m-d\TH:i:s'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user