diff --git a/src/lib/ldb/staff-ldb.svelte b/src/lib/ldb/staff-ldb.svelte index 81124c8..0021ded 100644 --- a/src/lib/ldb/staff-ldb.svelte +++ b/src/lib/ldb/staff-ldb.svelte @@ -58,10 +58,6 @@ isLoading = false; // Clear loading state } } - - function parseTime(sch, act){ - return - } function parseDateTime(input) { const dt = new Date(input); @@ -79,10 +75,35 @@ return json } - async function generateServiceStats(service) { + async function generateServiceData(service) { + let serviceData = { + to: await parseLocation(), + from: await parseLocation(), + length: await getTrainLength(service), + platform: await parsePlatform(), + } + return serviceData; + } + + async function getTrainLength(service) { return; } + async function parseLocation(location) { + return; + } + + async function parsePlatform(platform) { + if (platform === "TBC") { + return '-' + } + return platform; + } + + function parseTime(service){ + return + } + function processNrcc(messages) { // Remove newlines and then
tags from input and append to array let arrMessages; if (!Array.isArray(messages)) { @@ -122,7 +143,7 @@