StaffLDB-Minify #1

Merged
fred.boniface merged 27 commits from StaffLDB-Minify into main 2023-10-03 21:37:00 +01:00
Showing only changes of commit b173410dd6 - Show all commits

View File

@ -87,11 +87,15 @@
};
}
function fmtTime(date: Date | undefined): string | false {
if (!date) return false; // Handle null or undefined dates
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
return `${hours}:${minutes}`;
function fmtTime(date: Date | string | undefined): string | false {
if (date === 'RT' || date === "CANC" || date === "LATE") return date;
if (date instanceof Date) {
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
return `${hours}:${minutes}`;
} else {
return false;
}
}
</script>
@ -141,7 +145,7 @@
<tr>
<td colspan="1" />
<td class="tableTxt" colspan="7">
{#if service.destination?.[0]?.via}<span class="via">{service.destination[0].via}</span><br />{/if}
{#if service.destination?.[0] && service.destination[0].via}<span class="via">{service.destination[0].via}</span><br />{/if}
{tocMap.get(service.operatorCode.toLowerCase()) || service.operatorCode}
{#if service.length} | {service.length} carriages{/if}
{#if service.delayReason}