2021-02-12 18:19:49 +01:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<p class="time">
|
|
|
|
{{
|
2022-07-12 10:55:28 +02:00
|
|
|
formatDistanceToNow(new Date(event.publishAt), {
|
|
|
|
locale: dateFnsLocale,
|
2021-02-12 18:19:49 +01:00
|
|
|
addSuffix: true,
|
|
|
|
}) || $t("Right now")
|
|
|
|
}}
|
|
|
|
</p>
|
|
|
|
<EventCard :event="event" />
|
|
|
|
</div>
|
|
|
|
</template>
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2021-02-12 18:19:49 +01:00
|
|
|
import { IEvent } from "@/types/event.model";
|
|
|
|
import { formatDistanceToNow } from "date-fns";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { inject } from "vue";
|
2021-02-12 18:19:49 +01:00
|
|
|
import EventCard from "./EventCard.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
defineProps<{
|
|
|
|
event: IEvent;
|
|
|
|
}>();
|
2021-02-12 18:19:49 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const dateFnsLocale = inject<Locale>("dateFnsLocale");
|
2021-02-12 18:19:49 +01:00
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
p.time {
|
2021-06-18 19:28:59 +02:00
|
|
|
color: $violet-3;
|
2021-02-12 18:19:49 +01:00
|
|
|
}
|
|
|
|
</style>
|