Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Azer Koçulu committed Jul 23, 2012
1 parent f1db514 commit 434edb5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ Usage
On browsers:

```js
<script src="relative-date.js"></script>
<script>
assert( relativeDate(new Date()), 'just now' );
assert( relativeDate(1299627946000), '12 minutes ago');
assert( relativeDate(0), '41 years ago');
</script>
<script src="relative-date.js"></script>
<script>
assert( relativeDate(new Date()), 'just now' );
assert( relativeDate(1299627946000), '12 minutes ago');
assert( relativeDate(0), '41 years ago');
</script>
```

On a CommonJS compliant environment:

```js
> var relativeDate = require('relative-date');
> relativeDate(new Date())
'just now'
> relativeDate(1299627946000)
'12 minutes ago'
> relativeDate(0)
'41 years ago'
> var relativeDate = require('relative-date');
> relativeDate(new Date())
'just now'
> relativeDate(1299627946000)
'12 minutes ago'
> relativeDate(0)
'41 years ago'
```

Testing
Expand Down

0 comments on commit 434edb5

Please sign in to comment.