From 5f96a72e765e4bb0cf2e730d1941a29d9a00f6fd Mon Sep 17 00:00:00 2001 From: cnachtigall1991 <40701475+cnachtigall1991@users.noreply.github.com> Date: Sun, 17 Oct 2021 22:56:20 +0200 Subject: [PATCH] fixed date bug that displayed 1 days instead of 1 day --- src/utils/DateTime.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/DateTime.js b/src/utils/DateTime.js index a8bfda1..6f1294a 100644 --- a/src/utils/DateTime.js +++ b/src/utils/DateTime.js @@ -31,6 +31,8 @@ export const FormatDate = (date) => { return Math.floor(diff.as('hours')) + ' hour ago' else return Math.floor(diff.as('hours')) + ' hours ago' + else if (Math.floor(diff.as('days')) === 1) + return Math.floor(diff.as('days')) + ' day ago' else return Math.floor(diff.as('days')) + ' days ago' }