Only show times that are in the future

master
Elis Hirwing 2017-11-04 11:05:47 +01:00
parent 02ac39af65
commit 0dcb10805a
Signed by: etu
GPG Key ID: D57EFA625C9A925F
1 changed files with 10 additions and 8 deletions

View File

@ -72,15 +72,17 @@ func (sl *SL) GetOutput() string {
}
for _, v := range sl.lastResponse.ResponseData.Metros {
formattedTime, _ := sl.formatDisplayTime(v.ExpectedDateTime)
formattedTime, err := 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
})
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()