Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request moment#40 from luisfarzati/gh-pages
Browse files Browse the repository at this point in the history
Interval plugin
  • Loading branch information
timrwood committed Jun 3, 2013
2 parents 6630e44 + 137273f commit 1e4801c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions source/docs/plugins/interval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Interval is a plugin that lets you create time intervals easily.

```javascript
// using two moment objects
var june2013 = moment.interval(moment('2013-06-01'), moment('2013-06-30'));

// using ISO 8601 expressions
var lastWeek = moment.interval('P1W/');

// relative to a moment instance
var tenHoursQuarantineStartingNow = moment().interval(moment.duration(10, 'hours'));
```

Full documentation and sources [here](http://github.com/luisfarzati/moment-interval).

It's available on npm like so:

```
npm install moment-interval
```

Or just grab the JS file from [here](https://raw.github.com/luisfarzati/moment-interval/master/src/moment-interval.js).

0 comments on commit 1e4801c

Please sign in to comment.