# TimelineView not updating the flights in chapter 15

**URL:** <https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452>\
**Category:** SwiftUI by Tutorials\
**Created:** [February 12, 2022, 8:37pm UTC](https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452 "2022-02-12T20:37:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![snackdog](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/snackdog/32/110121_2.png) [@snackdog](https://forums.kodeco.com/u/snackdog)\
**Post date:** [February 12, 2022, 8:37pm UTC](https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452/1 "2022-02-12T20:37:11Z")

</div>

I think the TimelineView in chapter 15 is not working quite right. It’s not updating the flight list. Maybe we have to use onChange and monitor the context.date and do some kind of load of the flights data the way refreshable() works.

---

<div class="post-metadata">

**Author:** ![bmorefield](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bmorefield/32/111506_2.png) [@bmorefield](https://forums.kodeco.com/u/bmorefield)\
**Post date:** [February 20, 2022, 3:27pm UTC](https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452/2 "2022-02-20T15:27:34Z")

</div>

Can you provide a bit more detail on what you’re seeing? When is the list not updating?

---

<div class="post-metadata">

**Author:** ![snackdog](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/snackdog/32/110121_2.png) [@snackdog](https://forums.kodeco.com/u/snackdog)\
**Post date:** [February 20, 2022, 9:57pm UTC](https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452/3 "2022-02-20T21:57:44Z")

</div>

When you have TimelineView set to update every minute, its not updating the flight status so the times, like “6 minutes ago” are not updating. When you drag to refresh, the refreshable modifier is updating the flight status and so the relative time strings change.

---

<div class="post-metadata">

**Author:** ![taufi](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/taufi/32/105896_2.png) [@taufi](https://forums.kodeco.com/u/taufi)\
**Post date:** [December 30, 2022, 12:18pm UTC](https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452/4 "2022-12-30T12:18:01Z")

</div>

I did it this way:  
I passed the `context.date` as `currentDate` through FlightList to FlightRow:

> ```
> FlightList(
> flights: shownFlights.filter { $0.direction == .arrival },
> highlightedIds: $highlightedIds,
> currentDate: context.date
> )...
> 
> ```

and in FlightRow:

> `var currentDate: Date`

and in the `HStack`

> ```
> Text(relativeTimeFormatter.localizedString(for: flight.localTime, relativeTo: currentDate))
> 
> ```

This forces the Views to be rerendered every time `currentDate` changes.

---

<div class="post-metadata">

**Author:** ![hobozero](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hobozero/32/107361_2.png) [@hobozero](https://forums.kodeco.com/u/hobozero)\
**Post date:** [May 3, 2023, 7:44pm UTC](https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452/5 "2023-05-03T19:44:58Z")

</div>

I have the same issue. The “Last updated 5:54 PM” text changes every minute as expected, but the relative time for each flight in the List rows (i.e. “in 46 min.”) does not update until you scroll away from the row and return, or manually refresh the list.

---

<div class="post-metadata">

**Author:** ![steveluoxin](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/steveluoxin/32/105896_2.png) [@steveluoxin](https://forums.kodeco.com/u/steveluoxin)\
**Post date:** [July 16, 2024, 9:01am UTC](https://forums.kodeco.com/t/timelineview-not-updating-the-flights-in-chapter-15/164452/6 "2024-07-16T09:01:04Z")

</div>

It worked. Thank you.
