Skip to content

Commit

Permalink
Updated README to show examples with short parameter set
Browse files Browse the repository at this point in the history
  • Loading branch information
Limero committed Jun 22, 2016
1 parent 19ec863 commit 827a31a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Expand Up @@ -8,7 +8,7 @@ var ta = require('./time-ago.js')(); // node.js
var ta = timeago(); // browser
````

###ta.ago(...)
###ta.ago(..., [short])
````
ta.ago(new Date()-1000); => "1 second ago"
ta.ago(new Date()-2000); => "2 seconds ago"
Expand All @@ -21,6 +21,11 @@ ta.ago('Sun Jun 28 19:44:05 +0000 2013'); => "2 days ago"
// and UTC
ta.ago('1997-07-16T19:20+01:00'); => "16 years ago"
// with optional short parameter
ta.ago(new Date()-1000, true); => "1s"
ta.ago(new Date()-1000 * 60, true); => "1m"
ta.ago(new Date()-1000 * 60 * 60, true); => "1h"
````
###ta.today()
````
Expand All @@ -30,10 +35,10 @@ ta.today() function shows Day, Month, Date, Yr

###ta.timefriendly('x period')
````
ta.timefriendly('1 hour') // convert to ms: seconds, minutes, hours, days, weeks, months, years
ta.timefriendly('1 hour') // convert to ms: seconds, minutes, hours, days, weeks, months, years
==> 3600000
ta.timefriendly('1 hour') // convert to ms: seconds, minutes, hours, days, weeks, months, years
ta.timefriendly('1 hour') // convert to ms: seconds, minutes, hours, days, weeks, months, years
==> 3600000
````

Expand All @@ -48,4 +53,4 @@ ta.mintoread('six hundred words of text', ' minutes to finish') // optional alt
ta.mintoread('six hundred words of text', null, 300) // alternate wpm
==> "2 min to read"
````
````

0 comments on commit 827a31a

Please sign in to comment.