1.0.1 • Published 3 years ago
@schwad_rb/time-ago-in-words v1.0.1
@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'