Run prettier
This commit is contained in:
@@ -6,4 +6,4 @@ bun.lock
|
|||||||
bun.lockb
|
bun.lockb
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
/static/
|
#/static/
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1179,7 +1179,7 @@ routeDetail:
|
|||||||
diverges: right
|
diverges: right
|
||||||
direction: up
|
direction: up
|
||||||
elecBranch: none
|
elecBranch: none
|
||||||
description: to Southern Lines (Waterloo/Guildford)
|
description: Up/Dn Reading Spur to Southern Lines (Waterloo/Guildford)
|
||||||
miles: 35
|
miles: 35
|
||||||
chains: 40
|
chains: 40
|
||||||
|
|
||||||
@@ -1187,6 +1187,7 @@ routeDetail:
|
|||||||
position: under
|
position: under
|
||||||
category: rail
|
category: rail
|
||||||
name: Low Level Tunnel
|
name: Low Level Tunnel
|
||||||
|
description: Reading Low Level line
|
||||||
miles: 35
|
miles: 35
|
||||||
chains: 40
|
chains: 40
|
||||||
|
|
||||||
@@ -1250,4 +1251,4 @@ routeDetail:
|
|||||||
|
|
||||||
- type: continues
|
- type: continues
|
||||||
routeName: Reading West Jn - Bristol TM
|
routeName: Reading West Jn - Bristol TM
|
||||||
routeId: "0002"
|
routeId: '0002'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ elecEnd:
|
|||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user