Run prettier
This commit is contained in:
@@ -6,4 +6,4 @@ bun.lock
|
||||
bun.lockb
|
||||
|
||||
# Miscellaneous
|
||||
/static/
|
||||
#/static/
|
||||
|
||||
@@ -5,12 +5,6 @@
|
||||
|
||||
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(
|
||||
(m) =>
|
||||
m.routeId.toString().includes(searchTerm) ||
|
||||
@@ -26,6 +20,21 @@
|
||||
|
||||
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>
|
||||
|
||||
<div class="page-wrapper">
|
||||
@@ -91,9 +100,9 @@
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<span>Created: {formatDate(map.created)}</span>
|
||||
<span>Created on {formatDate(map.created)}</span>
|
||||
{#if map.checked}
|
||||
<span>• Checked: {formatDate(map.checked)}</span>
|
||||
<span>• Checked & Updated on {formatDate(map.checked)}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -1179,7 +1179,7 @@ routeDetail:
|
||||
diverges: right
|
||||
direction: up
|
||||
elecBranch: none
|
||||
description: to Southern Lines (Waterloo/Guildford)
|
||||
description: Up/Dn Reading Spur to Southern Lines (Waterloo/Guildford)
|
||||
miles: 35
|
||||
chains: 40
|
||||
|
||||
@@ -1187,6 +1187,7 @@ routeDetail:
|
||||
position: under
|
||||
category: rail
|
||||
name: Low Level Tunnel
|
||||
description: Reading Low Level line
|
||||
miles: 35
|
||||
chains: 40
|
||||
|
||||
@@ -1250,4 +1251,4 @@ routeDetail:
|
||||
|
||||
- type: continues
|
||||
routeName: Reading West Jn - Bristol TM
|
||||
routeId: "0002"
|
||||
routeId: '0002'
|
||||
|
||||
@@ -13,7 +13,7 @@ elecEnd:
|
||||
routeDetail:
|
||||
- type: continues
|
||||
routeName: Paddington - Reading West Jn
|
||||
routeId: "0001"
|
||||
routeId: '0001'
|
||||
- type: crossovers
|
||||
name: Scours Lane Junction
|
||||
description: Line diverges
|
||||
|
||||
Reference in New Issue
Block a user