changes
This commit is contained in:
@@ -249,10 +249,10 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import axios from "axios";
|
||||
import { useNuxtApp } from "nuxt/app";
|
||||
import { apiUrl } from "@/components/marketing/email/Email.utils";
|
||||
import type dayjs from "dayjs";
|
||||
|
||||
interface EmailSent {
|
||||
id: number;
|
||||
@@ -266,6 +266,7 @@ interface EmailSent {
|
||||
|
||||
const nuxtApp = useNuxtApp();
|
||||
const $snackbar = nuxtApp.$snackbar as (message?: string) => void;
|
||||
const $dayjs = nuxtApp.$dayjs as (date?: string | Date) => ReturnType<typeof dayjs>;
|
||||
|
||||
const emailsSent = ref<EmailSent[]>([]);
|
||||
const loading = ref(true);
|
||||
@@ -343,7 +344,7 @@ const formatDate = (dateString: string) => {
|
||||
const getRelativeTime = (dateString: string) => {
|
||||
try {
|
||||
if (dateString === "") return "";
|
||||
return formatDistanceToNow(new Date(dateString), { addSuffix: true });
|
||||
return $dayjs(new Date(dateString)).fromNow();
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user