diff --git a/src/lib/components/MyProfile/Timeline.svelte b/src/lib/components/MyProfile/Timeline.svelte index c062a4f..893661f 100644 --- a/src/lib/components/MyProfile/Timeline.svelte +++ b/src/lib/components/MyProfile/Timeline.svelte @@ -10,26 +10,41 @@ } else if (activityType.includes('DELETED') || activityType === 'UNLINK_SPOTIFY') { return 'bg-red-700'; // Removing something } - return 'bg-gray-400'; + return 'bg-gray-700'; + }; + + // Function to format the date + const formatDate = (date: Date): string => { + const today = new Date(); + const isToday = + date.getDate() === today.getDate() && + date.getMonth() === today.getMonth() && + date.getFullYear() === today.getFullYear(); + + if (isToday) { + return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); + } else { + return `${date.getFullYear()}.${String(date.getMonth() + 1).padStart(2, '0')}.${String(date.getDate()).padStart(2, '0')}`; + } }; -
+