timrwood/moment — pull request #311 by malandrew (2012-05-17 23:03:30+00:00)
Title: Added isPast() and isFuture() methods

I just added moment.isPast() and moment.isFuture() comparison methods. This can be used when you may want to conditionally print something that is dependent on a moment being in the future or in the past. e.g.:

```javascript
var eventStartTime = moment(eventModel.get('start_time'));

if (eventStartTime.isPast()) {
return "Last Event: " + eventStartTime.fromNow();
} else if (eventStartTime.isFuture()) {
return "Next Event: " + eventStartTime.fromNow();
}
```

I'm thinking about whether an isPresent() method with an optional tolerance passed in would be useful, e.g. ```moment().subtract('minutes', 30).isPresent('hours', 1);``` would return ```true```. This could be used in cases where you want to do something like:

```javascript
if (eventStartTime.isPresent('hours', 1) {
return "This event is happening now";
}
```