Skip to content

Commit

Permalink
day offset added
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian0KIM committed Dec 2, 2024
1 parent dd41edc commit 01dc1e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions back/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,12 @@ async function getPastBusArrival(routeId, stationId, staOrder, date, onlySevenDa

if (busArrivalList && busArrivalList.length > 0) {
const mappedData = applySpecialRouteMapping(busArrivalList, stationId, routeId);
cache[cacheKey] = mappedData;
allResults = allResults.concat(mappedData);
const dataWithOffset = mappedData.map(item => ({
...item,
daysAgo: Math.abs(dayOffset)
}));
cache[cacheKey] = dataWithOffset;
allResults = allResults.concat(dataWithOffset);
}
}

Expand Down
2 changes: 1 addition & 1 deletion front/lib/station_bus_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class _StationBusInfoPageState extends State<StationBusInfoPage> {
void initState() {
super.initState();
fetchBusData();
_timer = Timer.periodic(const Duration(seconds: 15), (timer) {
_timer = Timer.periodic(const Duration(seconds: 30), (timer) {
fetchBusData();
});
}
Expand Down
2 changes: 1 addition & 1 deletion front/lib/station_bus_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class _StationBusListPageState extends State<StationBusListPage> {
const Divider(height: 1),
Expanded(
child: ListView.separated(
//controller: _scrollController,
controller: _scrollController,
padding: EdgeInsets.zero,
itemCount: timeBasedData.length,
separatorBuilder: (context, index) => const Divider(height: 1),
Expand Down

0 comments on commit 01dc1e5

Please sign in to comment.