From 647b02e989d6cfa346ca791105bd00ac521c79f6 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 6 Jul 2021 16:46:45 +0200 Subject: [PATCH] Fix translating dates --- src/helpers/time/formatDate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/time/formatDate.js b/src/helpers/time/formatDate.js index faf37374..b1d6d46f 100644 --- a/src/helpers/time/formatDate.js +++ b/src/helpers/time/formatDate.js @@ -1,6 +1,6 @@ import {createDateFromString} from '@/helpers/time/createDateFromString' import {format, formatDistance} from 'date-fns' -import { enGB, de } from 'date-fns/locale' +import {enGB, de} from 'date-fns/locale' const locales = {enGB, de} @@ -30,7 +30,7 @@ export const formatDateSince = (date, $t) => { date = createDateFromString(date) const currentDate = new Date() - const distance = formatDistance(date, currentDate) + const distance = formatDistance(date, currentDate, {locale: locales[$t('date.locale')]}) if (date > currentDate) { return $t('date.in', {date: distance})