{service?.stops[0]['publicDeparture'] || service?.stops[0]['wttDeparture']} {service?.stops[0]['tiploc']} to {service?.stops[service['stops'].length - 1]['tiploc']} V
{#if isExpanded}
{#await getTrainByUID(service.trainUid)} {:then serviceDetail} {#if serviceDetail.stpIndicator === 'C'}

This has been removed from the timetable for today.

The service may have been retimed, re-routed or removed from todays timetable completely.

If it has been retimed or re-routed, there is likely to be another service with the same headcode booked to run.

{:else}
{#if serviceDetail.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.scheduleStart).toLocaleDateString('en-GB', { timeZone: 'UTC' })} - {new Date(serviceDetail.scheduleEnd).toLocaleDateString('en-GB', { timeZone: 'UTC' })}

{#each serviceDetail.stops as stop} {#if stop.publicArrival || stop.publicDeparture} {:else if stop.wttArrival || stop.wttDeparture} {:else} {/if} {/each}
Italics are 'pass' times, grey times are non-passenger stops
Location Plt. Sch Arr. Sch Dep.
{stop.tiploc} {stop.platform || '-'} {stop.publicArrival || '-'} {stop.publicDeparture || '-'}{stop.tiploc} {stop.platform || stop.depLine || stop.arrLine || '-'} {stop.wttArrival || '-'} {stop.wttDeparture || '-'}{stop.tiploc} {stop.platform || stop.depLine || stop.arrLine || '-'} - {stop.pass || '-'}
{/if} {:catch}

Unable to fetch train data

{/await}
{/if}