Show only three departures per stop

main
Jasper Bok 2023-08-13 17:04:01 +02:00
parent a28e406985
commit 48697c5fc9
2 changed files with 7 additions and 5 deletions

2
TODO
View File

@ -4,7 +4,7 @@
[x] *.. Print times in human-readable format.
[x] **. Always parse times in Dutch timezone.
[ ] *.. Show max three departures per stop.
[x] *.. Show max three departures per stop.
[ ] **. Show max two departures per line per stop.
[ ] **. Add Connexxion departures.
[ ] **. Make the page look nice (also on mobile).

View File

@ -16,12 +16,14 @@
<h2>{{ .Name }}</h2>
<p>{{ .Town }}</p>
{{ range .Departures }}
<dl>
<dt>{{ .RouteShortName }} | {{ .StopHeadsign }}</dt>
<dd><time>{{ formatTime .DepartureTime }}</time></dd>
</dl>
{{ range $i, $val := .Departures }}
{{ if lt $i 3 }}
<dt>{{ $val.RouteShortName }} | {{ $val.StopHeadsign }}</dt>
<dd><time>{{ formatTime $val.DepartureTime }}</time></dd>
{{ end }}
{{ end }}
</dl>
</article>
{{ end }}
</body>