Skip to content

Commit

Permalink
use agency tz
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed May 15, 2024
1 parent a43fcac commit 6d22719
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/components/SingleTripInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
let stoptimes_cleaned: any[] = [];
if (trip_data.tz != null) {
if (timezones.indexOf(trip_data.tz) === -1) {
timezones.push(trip_data.tz);
}
}
let index = 0;
data.stoptimes.forEach((stoptime: any) => {
if (timezones.indexOf(stoptime.timezone) === -1) {
Expand Down Expand Up @@ -348,15 +355,15 @@
{new Date(
stoptime.scheduled_arrival_time_unix_seconds * 1000
).toLocaleTimeString('en-UK', {
timeZone: stoptime.timezone || trip_data.timezone
timeZone: stoptime.timezone || trip_data.tz
})}
</span>
{/if}

{#if stoptime.rt_arrival_time}
<span class="text-sky-700 dark:text-sky-300">
{new Date(stoptime.rt_arrival_time * 1000).toLocaleTimeString('en-UK', {
timeZone: stoptime.timezone || trip_data.timezone
timeZone: stoptime.timezone || trip_data.tz
})}
</span>
{/if}
Expand Down Expand Up @@ -392,7 +399,7 @@
{new Date(
stoptime.scheduled_departure_time_unix_seconds * 1000
).toLocaleTimeString('en-UK', {
timeZone: stoptime.timezone || trip_data.timezone
timeZone: stoptime.timezone || trip_data.tz
})}
</span>
{/if}
Expand All @@ -401,7 +408,7 @@
<span class="text-sky-700 dark:text-sky-300">
{new Date(stoptime.rt_departure_time * 1000).toLocaleTimeString(
'en-UK',
{ timeZone: stoptime.timezone || trip_data.timezone }
{ timeZone: stoptime.timezone || trip_data.tz }
)}
</span>
{/if}
Expand All @@ -420,13 +427,7 @@
</div>
</div>

{
#if timezones.length > 1
}
<p>{$_('timezone')}: {stoptime.timezone || trip_data.timezone}</p>
{
/if
}

<!--<p class="text-sm">
index of stop seq: {stoptime.gtfs_stop_sequence}
</p>-->
Expand Down

0 comments on commit 6d22719

Please sign in to comment.