finishes translation
This commit is contained in:
@@ -123,7 +123,7 @@
|
||||
|
||||
switch (barChartSelectedValue) {
|
||||
case "duration":
|
||||
return "min";
|
||||
return "h";
|
||||
case "elevation_gain":
|
||||
case "elevation_loss":
|
||||
return unit == "metric" ? "m" : "ft";
|
||||
@@ -144,6 +144,8 @@
|
||||
(acc[date] || 0) + ((log as any)[barChartSelectedValue] ?? 0);
|
||||
if (barChartSelectedValue === "distance") {
|
||||
acc[date] = acc[date] / 1000;
|
||||
}else if(barChartSelectedValue === "duration") {
|
||||
acc[date] = acc[date] / 60 / 60;
|
||||
}
|
||||
if ($page.data.settings?.unit !== "metric") {
|
||||
acc[date] =
|
||||
@@ -193,7 +195,13 @@
|
||||
);
|
||||
|
||||
$: averageSpeed =
|
||||
totalDuration > 0 ? totalDistance / totalDuration : undefined;
|
||||
totalDuration > 0
|
||||
? $summitLogs.reduce(
|
||||
(sum, log) =>
|
||||
sum + (log.distance && log.duration ? log.distance : 0),
|
||||
0,
|
||||
) / totalDuration
|
||||
: undefined;
|
||||
|
||||
function updateFilterCategory(categories: SelectItem[]) {
|
||||
filter.category = categories.map((c) => c.value);
|
||||
@@ -201,10 +209,10 @@
|
||||
}
|
||||
|
||||
function handleDateClick(date: Date) {
|
||||
const datePlusN = new Date();
|
||||
const datePlusN = date;
|
||||
datePlusN.setDate(date.getDate() + 1);
|
||||
filter.startDate = datePlusN.toISOString().slice(0, 10);
|
||||
datePlusN.setDate(date.getDate() + 2);
|
||||
datePlusN.setDate(date.getDate() + 1);
|
||||
filter.endDate = datePlusN.toISOString().slice(0, 10);
|
||||
loadSummitLogs();
|
||||
}
|
||||
@@ -219,7 +227,6 @@
|
||||
<title>{$_("profile")} | wanderer</title>
|
||||
</svelte:head>
|
||||
|
||||
|
||||
<div
|
||||
class="grid grid-cols-1 md:grid-cols-[356px_minmax(0,_1fr)] gap-y-4 items-start max-w-6xl mx-auto"
|
||||
>
|
||||
@@ -304,7 +311,7 @@
|
||||
<span class="text-gray-500 font-semibold text-lg self-start"
|
||||
><i class="fa fa-clock mr-3"></i>{$_("duration")}</span
|
||||
>
|
||||
<p class="text-4xl font-bold">{formatTimeHHMM(totalDuration)}</p>
|
||||
<p class="text-4xl font-bold">{formatTimeHHMM(totalDuration / 60)}</p>
|
||||
</div>
|
||||
<div
|
||||
class="flex flex-col items-center gap-6 border border-input-border rounded-xl p-6"
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import type { SummitLogFilter } from "$lib/models/summit_log";
|
||||
import { categories_index } from "$lib/stores/category_store";
|
||||
import { summit_logs_index } from "$lib/stores/summit_log_store";
|
||||
import { fetchGPX } from "$lib/stores/trail_store";
|
||||
import { type ServerLoad } from "@sveltejs/kit";
|
||||
|
||||
export const load: ServerLoad = async ({ params, locals, fetch }) => {
|
||||
|
||||
const date = new Date(), y = date.getFullYear(), m = date.getMonth();
|
||||
const firstDay = new Date(y, m, 1);
|
||||
const lastDay = new Date(y, m + 1, 0);
|
||||
const date = new Date()
|
||||
date.setUTCHours(6)
|
||||
const y = date.getFullYear()
|
||||
const m = date.getMonth();
|
||||
const firstDay = new Date(y, m, 2);
|
||||
const lastDay = new Date(y, m + 1, 1);
|
||||
|
||||
const categories = await categories_index(fetch)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user