From 11d900e7f7c1d4b09b6ea72ff702d82b5c1c8bd5 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Thu, 5 Sep 2024 21:16:24 +0200 Subject: [PATCH] Added compact translations for date duration --- components/calendar/CalendarEventDetails.vue | 4 +--- .../calendar/search/lists/EventCallout.vue | 4 +--- i18n.config.ts | 16 ++++++++++++++++ stores/CalendarStore.ts | 19 +++++++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/components/calendar/CalendarEventDetails.vue b/components/calendar/CalendarEventDetails.vue index 5445968..910068b 100644 --- a/components/calendar/CalendarEventDetails.vue +++ b/components/calendar/CalendarEventDetails.vue @@ -30,9 +30,7 @@ const eventDetails = ref() const emit = defineEmits(["query:close-popover"]) const dateDifference: string = getRelativeString(defaultDate, props.event.startDate) -const dateDuration: string | null = props.event.endDate - ? getRelativeString(props.event.startDate, props.event.endDate, "compact") - : null +const dateDuration = computed(() => props.event.endDate ? getRelativeString(props.event.startDate, props.event.endDate, "compact") : null) function handleJumpToDate(date: RPGDate) { jumpToDate(date) diff --git a/components/calendar/search/lists/EventCallout.vue b/components/calendar/search/lists/EventCallout.vue index 2d3965d..87fb8e4 100644 --- a/components/calendar/search/lists/EventCallout.vue +++ b/components/calendar/search/lists/EventCallout.vue @@ -16,9 +16,7 @@ defineEmits<{ const { getRelativeString, defaultDate, getFormattedDateTitle } = useCalendar() const dateDifference: string = getRelativeString(defaultDate, props.event.startDate) -const dateDuration: string | null = props.event.endDate - ? getRelativeString(props.event.startDate, props.event.endDate, "compact") - : null +const dateDuration = computed(() => props.event.endDate ? getRelativeString(props.event.startDate, props.event.endDate, "compact") : null)