diff --git a/src/lib/train/train-detail.svelte b/src/lib/train/train-detail.svelte index bfd6ac1..e340010 100644 --- a/src/lib/train/train-detail.svelte +++ b/src/lib/train/train-detail.svelte @@ -38,7 +38,7 @@ {service?.stops[0]['publicDeparture'] || service?.stops[0]['wttDeparture']} - {service?.stops[0]['tiploc']} to {service?.stops[service['stops'].length - 1]['tiploc']}{#if (service?.vstp)}VSTP{/if} V @@ -47,49 +47,54 @@ {#await getTrainByUID(service.trainUid)} {:then serviceDetail} -
- {#if serviceDetail.pis} -

PIS:

- {/if} -

- Planned Type: {parseInt(serviceDetail.planSpeed) || '--'}mph {serviceDetail.powerType || 'Non-Rail vehicle'} -

-

- Days Run: {serviceDetail?.daysRun.join(', ').toUpperCase() || 'Unknown'} -

-

- Valid From: {new Date(serviceDetail.scheduleStartDate).toLocaleDateString('en-GB', { - timeZone: 'UTC' - })} - {new Date(serviceDetail.scheduleEndDate).toLocaleDateString('en-GB', { - timeZone: 'UTC' - })} -

- - - - - - - {#if serviceDetail.stops[0]['publicDeparture']} - {#each serviceDetail.stops as stop} - {#if stop.publicArrival || stop.publicDeparture} + {#if serviceDetail.stpIndicator === 'C'} + This has been removed from the timetable for today
+ It is likely another service is running in its place + {:else} +
+ {#if serviceDetail.pis} +

PIS:

+ {/if} +

+ Planned Type: {parseInt(serviceDetail.planSpeed) || '--'}mph {serviceDetail.powerType || 'Non-Rail vehicle'} +

+

+ Days Run: {serviceDetail?.daysRun.join(', ').toUpperCase() || 'Unknown'} +

+

+ Valid From: {new Date(serviceDetail.scheduleStartDate).toLocaleDateString('en-GB', { + timeZone: 'UTC' + })} - {new Date(serviceDetail.scheduleEndDate).toLocaleDateString('en-GB', { + timeZone: 'UTC' + })} +

+
LocationSch Arr.Sch Dep.
+ + + + + + {#if serviceDetail.stops[0]['publicDeparture']} + {#each serviceDetail.stops as stop} + {#if stop.publicArrival || stop.publicDeparture} + + + + + + {/if} + {/each} + {:else} + {#each serviceDetail.stops as stop} - - + + - {/if} - {/each} - {:else} - {#each serviceDetail.stops as stop} - - - - - - {/each} - {/if} -
LocationSch Arr.Sch Dep.
{stop.tiploc}{stop.publicArrival || '-'}{stop.publicDeparture || '-'}
{stop.tiploc}{stop.publicArrival || '-'}{stop.publicDeparture || '-'}{stop.wttArrival || '-'}{stop.wttDeparture || '-'}
{stop.tiploc}{stop.wttArrival || '-'}{stop.wttDeparture || '-'}
+ {/each} + {/if} + + {/if} {:catch}

Unable to fetch train data

{/await}