mobilizon/js/src/components/Event/RecentEventCardWrapper.vue
Thomas Citharel 57c3df43ff
Remove SCSS variables
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-08-11 19:48:29 +02:00

26 lines
601 B
Vue

<template>
<div>
<p class="time">
{{
formatDistanceToNow(new Date(event.publishAt), {
locale: dateFnsLocale,
addSuffix: true,
}) || $t("Right now")
}}
</p>
<EventCard :event="event" />
</div>
</template>
<script lang="ts" setup>
import { IEvent } from "@/types/event.model";
import { formatDistanceToNow } from "date-fns";
import { inject } from "vue";
import EventCard from "./EventCard.vue";
import type { Locale } from "date-fns";
defineProps<{
event: IEvent;
}>();
const dateFnsLocale = inject<Locale>("dateFnsLocale");
</script>