timrwood/moment — pull request #800 by timrwood (2013-05-23 19:26:22+00:00)
Title: Adding moment#min and moment#max #755

This adds the `max` and `min` methods noted in #755.

The max method returns the original moment only if it is before the max. Otherwise, it returns the max.

```javascript
pastMoment.max('now'); // pastMoment
futureMoment.max('now'); // now
futureMoment.max(pastMoment); // pastMoment
```

The min method returns the original moment only if it is after the min. Otherwise, it returns the min.

```javascript
pastMoment.min('now'); // now
futureMoment.min('now'); // futureMoment
futureMoment.min(pastMoment); // futureMoment
```

Both methods accept anything that can be passed to `moment()`.

```javascript
moment().max("septiembre 3 2006", "MMMM D YYYY", "es");
```

For readability, it also supports the 'now' keyword. Passing no parameters has the same effect as passing in `moment()`.

```javascript
// all different names for the same thing
moment().max("now");
moment().max();
moment().max(moment());
```