finishes translation

This commit is contained in:
Christian Beutel
2024-11-05 01:23:06 +01:00
parent 87eb879c7f
commit 81d309c582
9 changed files with 28 additions and 18 deletions

View File

@@ -123,7 +123,8 @@
if (!date) {
return;
}
console.log(date);
dispatch("click", date);
}
</script>

View File

@@ -114,7 +114,7 @@
>
<span
><i class="fa fa-clock mr-2"></i>{formatTimeHHMM(
log.duration,
log.duration ? log.duration / 60 : undefined,
)}</span
>
<span

View File

@@ -55,7 +55,7 @@
const totals = gpxObject.getTotals();
$form.duration = totals.duration / 1000 / 60;
$form.duration = totals.duration / 1000;
$form.elevation_gain = totals.elevationGain;
$form.elevation_loss = totals.elevationLoss;
$form.distance = totals.distance;

View File

@@ -103,7 +103,7 @@
{formatElevation(log.elevation_loss)}
</td>
<td>
{formatTimeHHMM(log.duration)}
{formatTimeHHMM(log.duration ? log.duration / 60 : undefined)}
</td>
{#if showCategory}
<td>

View File

@@ -19,7 +19,7 @@
"altitude": "Höhe",
"api-documentation": "API Dokumentation",
"avatar": "Avatar",
"average-speed": "Durschn. Geschwindigkeit",
"average-speed": "Durchschn. Geschwindigkeit",
"basic-info": "Basisinformation",
"before": "Vor",
"can": "kann",

View File

@@ -58,9 +58,9 @@ export function formatSpeed(speed?: number) {
const unit = get(page).data.settings?.unit ?? "metric";
if (unit == "metric") {
return `${Math.round(speed)} km/h`
return `${(speed * 3.6).toFixed(2)} km/h`
} else {
const mph = speed * 0.621371;
const mph = speed * 3.6 * 0.621371;
return `${Math.round(mph)} mp/h`;
}

View File

@@ -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"

View File

@@ -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)