fix: refactor, docker, dateformatter

This commit is contained in:
Levente Orban
2025-08-27 11:45:41 +02:00
parent c11060deab
commit 91209d9efc
11 changed files with 266 additions and 199 deletions

View File

@@ -1,6 +1,7 @@
<script lang="ts">
import type { Event } from '$lib/types';
import { goto } from '$app/navigation';
import { formatTime, formatDate } from '$lib/dateFormatter';
export let data: { events: Event[] };
@@ -56,19 +57,6 @@
showDeleteModal = false;
eventToDelete = null;
}
function formatDate(dateString: string): string {
const date = new Date(dateString);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}/${month}/${day}`;
}
function formatTime(timeString: string): string {
const [hours, minutes] = timeString.split(':');
return `${hours}:${minutes}`;
}
</script>
<svelte:head>