don't show time less than 0

This commit is contained in:
ammarahm-ed
2020-12-10 14:46:49 +05:00
parent e68eca2777
commit ab5a155901

View File

@@ -25,7 +25,9 @@ export function timeSince(date) {
if (interval > 0.9) {
return interval < 2 ? interval + ' min ago' : interval + ' min ago';
}
return Math.floor(seconds) + ' secs ago';
return Math.floor(seconds) < 0
? '0 secs ago'
: Math.floor(seconds) + ' secs ago';
}
export const timeConverter = (timestamp) => {