I have stored RSS feed's published date "pubDate" in a JS string variable. Now I need to show it in a more readable way like "2 seconds ago, 5 minutes ago, an hour ago, 5 days ago, a month ago, 1 year ago" like in PrettyDate, MomentJS. It should be light weight. And shouldn't use external JS plugins.
I can change the initial date string using toGMTString(), toISOString(), toString() or toLocaleString(). How can I do this?