fixed date bug that displayed 1 days instead of 1 day

This commit is contained in:
cnachtigall1991
2021-10-17 22:56:20 +02:00
parent dbc104f837
commit 5f96a72e76

View File

@@ -31,6 +31,8 @@ export const FormatDate = (date) => {
return Math.floor(diff.as('hours')) + ' hour ago' return Math.floor(diff.as('hours')) + ' hour ago'
else else
return Math.floor(diff.as('hours')) + ' hours ago' 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 else
return Math.floor(diff.as('days')) + ' days ago' return Math.floor(diff.as('days')) + ' days ago'
} }