diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 0c529a2..b72b5fc 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -59,6 +59,8 @@ const messages: LocaleMessages = { thisMonth: 'This Month', myTickets: 'My tickets', hosting: 'Hosting', + pastEvents: 'Past events', + past: 'Past', }, categories: { concert: 'Concert', @@ -104,6 +106,7 @@ const messages: LocaleMessages = { buyAnotherTicket: 'Buy another ticket', viewMyTickets: 'View in My Tickets', soldOut: 'Sold Out', + pastEvent: 'This event has already happened', free: 'Free', }, tickets: { diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index e72be71..4d57c91 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -59,6 +59,8 @@ const messages: LocaleMessages = { thisMonth: 'Este mes', myTickets: 'Mis boletos', hosting: 'Organizo', + pastEvents: 'Eventos pasados', + past: 'Pasado', }, categories: { concert: 'Concierto', @@ -104,6 +106,7 @@ const messages: LocaleMessages = { buyAnotherTicket: 'Comprar otro boleto', viewMyTickets: 'Ver en Mis boletos', soldOut: 'Agotado', + pastEvent: 'Este evento ya pasó', free: 'Gratis', }, tickets: { diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 3b6ed76..3c429ad 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -59,6 +59,8 @@ const messages: LocaleMessages = { thisMonth: 'Ce mois-ci', myTickets: 'Mes billets', hosting: 'J\'organise', + pastEvents: 'Événements passés', + past: 'Passé', }, categories: { concert: 'Concert', @@ -104,6 +106,7 @@ const messages: LocaleMessages = { buyAnotherTicket: 'Acheter un autre billet', viewMyTickets: 'Voir dans Mes billets', soldOut: 'Épuisé', + pastEvent: 'Cet événement est déjà passé', free: 'Gratuit', }, tickets: { diff --git a/src/i18n/types.ts b/src/i18n/types.ts index 4e5584d..05c7282 100644 --- a/src/i18n/types.ts +++ b/src/i18n/types.ts @@ -60,6 +60,8 @@ export interface LocaleMessages { thisMonth: string myTickets: string hosting: string + pastEvents: string + past: string } categories: Record detail: { @@ -79,6 +81,7 @@ export interface LocaleMessages { buyAnotherTicket: string viewMyTickets: string soldOut: string + pastEvent: string free: string } tickets: { diff --git a/src/modules/activities/components/ActivityCard.vue b/src/modules/activities/components/ActivityCard.vue index d16c376..442f423 100644 --- a/src/modules/activities/components/ActivityCard.vue +++ b/src/modules/activities/components/ActivityCard.vue @@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n' import { format } from 'date-fns' import { Card, CardContent } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' -import { MapPin, Calendar, Ticket, User, CheckCircle2 } from 'lucide-vue-next' +import { MapPin, Calendar, Ticket, User, CheckCircle2, History } from 'lucide-vue-next' import BookmarkButton from './BookmarkButton.vue' import { useDateLocale } from '../composables/useDateLocale' import { useOwnedTickets } from '../composables/useOwnedTickets' @@ -58,6 +58,13 @@ const placeholderBg = computed(() => { const hue = hash % 360 return `hsl(${hue}, 40%, 85%)` }) + +const isPast = computed(() => { + const a = props.activity + const end = a.endDate ?? a.startDate + if (!end || isNaN(end.getTime())) return false + return end.getTime() < Date.now() +})