sorts summit log entries by date
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
if (!log.expand.gpx_data) {
|
if (!log.expand.gpx_data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
layerGroup.clearLayers();
|
layerGroup.clearLayers();
|
||||||
const geoJson = gpx(
|
const geoJson = gpx(
|
||||||
new DOMParser().parseFromString(log.expand.gpx_data, "text/xml"),
|
new DOMParser().parseFromString(log.expand.gpx_data, "text/xml"),
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
layerGroup.addLayer(startMarker);
|
layerGroup.addLayer(startMarker);
|
||||||
layerGroup.addLayer(endMarker)
|
layerGroup.addLayer(endMarker);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filter: (feature: any, layer: any) => {
|
filter: (feature: any, layer: any) => {
|
||||||
|
|||||||
@@ -73,17 +73,17 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<tr class="h-24 text-center">
|
<tr class="text-center">
|
||||||
<td>
|
<td>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
on:click={openMap}
|
on:click={openMap}
|
||||||
class="h-24 aspect-square shrink-0 rounded-xl !bg-background"
|
class="h-20 aspect-square shrink-0 rounded-xl !bg-background"
|
||||||
class:hidden={!log.expand.gpx_data}
|
class:hidden={!log.expand.gpx_data}
|
||||||
id="mini-map-{index}"
|
id="mini-map-{index}"
|
||||||
></button>
|
></button>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td class:py-4={!log.text && !log.expand.gpx_data}
|
||||||
>{new Date(log.date).toLocaleDateString(undefined, {
|
>{new Date(log.date).toLocaleDateString(undefined, {
|
||||||
month: "2-digit",
|
month: "2-digit",
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
@@ -111,8 +111,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{#if showText}
|
{#if showText}
|
||||||
<tr
|
<tr
|
||||||
><td class="text-left text-sm whitespace-pre-wrap" colspan="6"
|
><td class="text-left text-sm whitespace-pre-wrap pb-4" colspan="6"
|
||||||
>{log.text}</td
|
>{log.text}</td
|
||||||
></tr
|
></tr
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
<tr>
|
||||||
|
<td colspan="6"> <hr /> </td>
|
||||||
|
</tr>
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ export async function trails_show(id: string, loadGPX?: boolean, f: (url: Reques
|
|||||||
}
|
}
|
||||||
|
|
||||||
response.expand.waypoints = response.expand.waypoints || [];
|
response.expand.waypoints = response.expand.waypoints || [];
|
||||||
response.expand.summit_logs = response.expand.summit_logs || [];
|
response.expand.summit_logs = response.expand.summit_logs.sort((a: SummitLog, b: SummitLog) => Date.parse(a.date) - Date.parse(b.date)) || [];
|
||||||
|
|
||||||
trail.set(response);
|
trail.set(response);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user