fix: show replacement dates as dd/mm/yyyy
This commit is contained in:
@@ -83,6 +83,11 @@
|
|||||||
|
|
||||||
const GEAR_ICONS: Record<string, string> = { bike: '🚲', shoes: '👟', skis: '🎿', other: '⚙️' };
|
const GEAR_ICONS: Record<string, string> = { bike: '🚲', shoes: '👟', skis: '🎿', other: '⚙️' };
|
||||||
|
|
||||||
|
function fmtDate(iso: string): string {
|
||||||
|
const [y, m, d] = iso.split('-');
|
||||||
|
return `${d}/${m}/${y}`;
|
||||||
|
}
|
||||||
|
|
||||||
const PART_SUGGESTIONS: Record<string, { name: string; threshold_km: number }> = {
|
const PART_SUGGESTIONS: Record<string, { name: string; threshold_km: number }> = {
|
||||||
bike: { name: 'chain', threshold_km: 3000 },
|
bike: { name: 'chain', threshold_km: 3000 },
|
||||||
shoes: { name: 'running shoes', threshold_km: 750 },
|
shoes: { name: 'running shoes', threshold_km: 750 },
|
||||||
@@ -751,7 +756,7 @@
|
|||||||
<div class="pl-2 space-y-0.5">
|
<div class="pl-2 space-y-0.5">
|
||||||
{#each part.replacements.slice().reverse().slice(0, 3) as rep (rep.id)}
|
{#each part.replacements.slice().reverse().slice(0, 3) as rep (rep.id)}
|
||||||
<div class="flex items-center gap-2 text-xs text-zinc-600">
|
<div class="flex items-center gap-2 text-xs text-zinc-600">
|
||||||
<span>{rep.date}</span>
|
<span>{fmtDate(rep.date)}</span>
|
||||||
{#if rep.note}<span class="text-zinc-500">{rep.note}</span>{/if}
|
{#if rep.note}<span class="text-zinc-500">{rep.note}</span>{/if}
|
||||||
<button
|
<button
|
||||||
on:click={() => deleteReplacement(item.id, part.id, rep.id)}
|
on:click={() => deleteReplacement(item.id, part.id, rep.id)}
|
||||||
|
|||||||
Reference in New Issue
Block a user