Browse Source

Only show times that are in the future

master
Elis Hirwing 2 years ago
parent
commit
0dcb10805a
Signed by: etu <elis@hirwing.se> GPG Key ID: D57EFA625C9A925F
1 changed files with 11 additions and 9 deletions
  1. +11
    -9
      src/statusscreen/SL.go

+ 11
- 9
src/statusscreen/SL.go View File

@@ -72,15 +72,17 @@ func (sl *SL) GetOutput() string {
}

for _, v := range sl.lastResponse.ResponseData.Metros {
formattedTime, _ := sl.formatDisplayTime(v.ExpectedDateTime)

table.Append([]string{
v.LineNumber,
v.Destination,
formattedTime,
v.TimeTabledDateTime[11:], // Remove YYYY-MM-DDT from the beginning of the string
v.ExpectedDateTime[11:], // Remove YYYY-MM-DDT from the beginning of the string
})
formattedTime, err := sl.formatDisplayTime(v.ExpectedDateTime)

if err == nil {
table.Append([]string{
v.LineNumber,
v.Destination,
formattedTime,
v.TimeTabledDateTime[11:], // Remove YYYY-MM-DDT from the beginning of the string
v.ExpectedDateTime[11:], // Remove YYYY-MM-DDT from the beginning of the string
})
}
}

table.Render()


Loading…
Cancel
Save