Get Date object from Timeago string
Parse timeago expression (ie. 2 days ago
) and get an approximate Date object.
npm i timeago-reverse
npm test
const tr = require('timeago-reverse');
const myDate = tr.parse('14 hours ago');
now
just now
any moment now
tomorrow
today
yesterday
less than a minute
less than a minute ago
in less than a minute
Format: [a/an/${amount}] ${unit} [ago]
second
second ago
a second
a second ago
an hour
1 second ago
30 seconds
30 seconds ago
Format: [in] [a/an/${amount}] ${unit} [from now]
second from now
a second from now
1 second from now
30 seconds from now
in second
in a second
in 1 second
in 20 seconds
Supported in both singular and plural forms.