mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add tooltip for post dates
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user