@schwad_rb/time-ago-in-words
v1.0.1
Published
A JS clone of Rails' time_ago_in_words
Downloads
2
Maintainers
Readme
@schwad_rb/time-ago-in-words
Attribution
I wanted Rails' time_ago_in_words in Javascript. There was a stackoverflow answer which pretty much gave us that. So I packaged it. Thanks @vsync
Usage
Pass in a date object. Voila
timeAgoInWords(new Date('2022-01-01'))
// #=> '3 months ago'