add tooltip for post dates

This commit is contained in:
plebeius.eth
2023-08-17 13:15:37 +02:00
parent 9b66334577
commit 9085e235e1
7 changed files with 124 additions and 23 deletions
+14
View File
@@ -0,0 +1,14 @@
import en from 'javascript-time-ago/locale/en'
import TimeAgo from 'javascript-time-ago'
TimeAgo.addDefaultLocale(en);
const timeAgo = new TimeAgo('en-US');
const getFormattedTime = (timestamp) => {
try {
return timeAgo.format(timestamp * 1000)
}
catch (e) {}
};
export default getFormattedTime;