feat: include departure daytime in travel info if applicable
addresses #86996x46z
This commit is contained in:
@@ -79,9 +79,19 @@ class TravelinfoController extends ActionController
|
||||
return 'VPF' === $service['subType'];
|
||||
});
|
||||
|
||||
// extract bus departure time if applicable
|
||||
$departureDayTime = null;
|
||||
$service = array_filter($travelData['transportationServices'] ?? [], function ($service) {
|
||||
return 'BUS' === $service['subType'] && 'RUECK' === $service['direction'];
|
||||
});
|
||||
if (null !== $service[0] ?? null) {
|
||||
$departureDayTime = $service[0]['dayTime'];
|
||||
}
|
||||
|
||||
$this->view->assign('travelInfo', $travelInfo);
|
||||
$this->view->assign('travelData', $travelData);
|
||||
$this->view->assign('courses', $courses);
|
||||
$this->view->assign('board', $board);
|
||||
$this->view->assign('departureDayTime', $departureDayTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,6 +288,11 @@
|
||||
</tr>
|
||||
</f:for>
|
||||
</table>
|
||||
<f:if condition="{departureDayTime}">
|
||||
<p>
|
||||
Die Rückreise mit dem Bus startet <strong>{departureDayTime}</strong>.
|
||||
</p>
|
||||
</f:if>
|
||||
{travelInfo.departureText -> f:format.html()}
|
||||
</f:section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user