@@ -79,12 +79,15 @@ func main() {
7979
8080 for _ , slice := range offer .Slices {
8181 for _ , segment := range slice .Segments {
82+ dep , _ := segment .DepartingAt ()
83+ arr , _ := segment .ArrivingAt ()
8284 t .AppendRow (table.Row {
8385 slice .ID ,
8486 segment .Origin .IATACode ,
8587 segment .Destination .IATACode ,
86- time .Time (segment .DepartingAt ).Format (time .RFC822 ),
87- time .Time (segment .ArrivingAt ).Format (time .RFC822 ),
88+
89+ dep .Format (time .RFC822 ),
90+ arr .Format (time .RFC822 ),
8891 segment .Passengers [0 ].CabinClass .String (),
8992 renderChangeableStatus (slice ),
9093 })
@@ -209,25 +212,30 @@ func main() {
209212
210213 for _ , slice := range offer .Slices .Add {
211214 for _ , segment := range slice .Segments {
215+ dep , _ := segment .DepartingAt ()
216+ arr , _ := segment .ArrivingAt ()
217+
212218 t .AppendRow (table.Row {
213219 fmt .Sprintf ("Add %s" , slice .ID ),
214220 segment .Origin .IATACode ,
215221 segment .Destination .IATACode ,
216- time . Time ( segment . DepartingAt ) .Format (time .RFC822 ),
217- time . Time ( segment . ArrivingAt ) .Format (time .RFC822 ),
222+ dep .Format (time .RFC822 ),
223+ arr .Format (time .RFC822 ),
218224 // segment.Passengers != nil && segment.Passengers[0].CabinClass.String(),
219225 renderChangeableStatus (slice ),
220226 })
221227 }
222228 }
223229 for _ , slice := range offer .Slices .Remove {
224230 for _ , segment := range slice .Segments {
231+ dep , _ := segment .DepartingAt ()
232+ arr , _ := segment .ArrivingAt ()
225233 t .AppendRow (table.Row {
226234 fmt .Sprintf ("Remove %s" , slice .ID ),
227235 segment .Origin .IATACode ,
228236 segment .Destination .IATACode ,
229- time . Time ( segment . DepartingAt ) .Format (time .RFC822 ),
230- time . Time ( segment . ArrivingAt ) .Format (time .RFC822 ),
237+ dep .Format (time .RFC822 ),
238+ arr .Format (time .RFC822 ),
231239 segment .Passengers [0 ].CabinClass .String (),
232240 renderChangeableStatus (slice ),
233241 })
0 commit comments