Permalink
Browse files

add example

  • Loading branch information...
1 parent 7b4d79c commit 081fad3d8a533dbccc7696f05ec3d6144bd73c31 @tj tj committed Sep 26, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 Readme.md
View
12 Readme.md
@@ -7,6 +7,18 @@
$ component install component/relative-date
+## Example
+
+```js
+var date = new Date(Date.now() - 60000);
+console.log(relative(date) + ' ago');
+// => "one minute ago"
+
+var date = new Date(Date.now() + 5 * 60000);
+console.log(relative(date) + ' from now');
+// => "5 minutes from now"
+```
+
## API
### relative(date)

0 comments on commit 081fad3

Please sign in to comment.