Run prettier

This commit is contained in:
2026-02-07 00:38:56 +00:00
parent ca5e78e2b1
commit cfa1d44dbc
4 changed files with 1275 additions and 1265 deletions

View File

@@ -6,4 +6,4 @@ bun.lock
bun.lockb bun.lockb
# Miscellaneous # Miscellaneous
/static/ #/static/

View File

@@ -5,12 +5,6 @@
let searchTerm = ''; let searchTerm = '';
const formatDate = (dateVal: string | null) => {
if (!dateVal) return '---';
const d = new Date(dateVal);
return d.toLocaleDateString('en-GB', { day: '2-digit', month: 'short', year: '2-digit' });
};
$: filteredMaps = data.maps.filter( $: filteredMaps = data.maps.filter(
(m) => (m) =>
m.routeId.toString().includes(searchTerm) || m.routeId.toString().includes(searchTerm) ||
@@ -26,6 +20,21 @@
return checkedDate > oneYearAgo ? 'verified' : 'stale'; return checkedDate > oneYearAgo ? 'verified' : 'stale';
}; };
const formatDate = (dateVal: string | null) => {
if (!dateVal) return 'N/A';
const date = new Date(dateVal);
// Check for invalid dates to avoid "NaN/NaN/NaN"
if (isNaN(date.getTime())) return 'Invalid Date';
const d = date.getDate().toString().padStart(2, '0');
const m = (date.getMonth() + 1).toString().padStart(2, '0');
const y = date.getFullYear().toString().slice(-2);
return `${d}/${m}/${y}`;
};
</script> </script>
<div class="page-wrapper"> <div class="page-wrapper">
@@ -91,9 +100,9 @@
</div> </div>
<div class="card-footer"> <div class="card-footer">
<span>Created: {formatDate(map.created)}</span> <span>Created on {formatDate(map.created)}</span>
{#if map.checked} {#if map.checked}
<span>• Checked: {formatDate(map.checked)}</span> <span>• Checked & Updated on {formatDate(map.checked)}</span>
{/if} {/if}
</div> </div>
</a> </a>
@@ -108,7 +117,7 @@
:global(body) { :global(body) {
margin: 0; margin: 0;
background-color: #404c55; background-color: #404c55;
background-image: radial-gradient(#2b343c,#404c55); background-image: radial-gradient(#2b343c, #404c55);
color: #0f172a; color: #0f172a;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
} }
@@ -121,16 +130,16 @@
.main-header { .main-header {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
background: #3c6f79; background: #3c6f79;
color: #ebebeb; color: #ebebeb;
} }
.brand-container { .brand-container {
margin: 15px; margin: 15px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 1rem; gap: 1rem;
@@ -198,7 +207,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1rem;
padding-top: 90px; padding-top: 90px;
} }
.card { .card {

File diff suppressed because it is too large Load Diff

View File

@@ -11,11 +11,11 @@ elecStart:
elecEnd: elecEnd:
elec: none elec: none
routeDetail: routeDetail:
- type: continues - type: continues
routeName: Paddington - Reading West Jn routeName: Paddington - Reading West Jn
routeId: "0001" routeId: '0001'
- type: crossovers - type: crossovers
name: Scours Lane Junction name: Scours Lane Junction
description: Line diverges description: Line diverges
miles: 38 miles: 38
chains: 90 chains: 90