Fix future date string (#637)

This commit is contained in:
saltrafael 2022-01-06 16:09:17 -03:00 committed by GitHub
parent bc38466abf
commit 0a986b1603
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,7 @@ export function getTimeAgoStr(date: any, showFutureDate?: boolean, genericSecond
}); });
// Strip off the ending 's' for the singular suffix // Strip off the ending 's' for the singular suffix
if (duration === 1) suffix = suffix.replace(/s$/g, ''); if (duration === 1 || (duration === -1 && showFutureDate)) suffix = suffix.replace(/s$/g, '');
// negative duration === it's a future date from now // negative duration === it's a future date from now
if (duration < 0 && showFutureDate) { if (duration < 0 && showFutureDate) {