Marak/faker.js — pull request #138 by unindented (2014-11-12 08:54:00+00:00)
Title: Have past, future and recent return random dates

Functions `past` and `future` only returned dates EXACTLY N YEARS before or after the reference date. Function `recent` only returned dates EXACTLY N DAYS before the reference date.

For example, `faker.date.past(1)` would return either *Nov 12, 2014*, or *Nov 12, 2013* with the current time, and nothing else:

```
$ node
> var faker = require('./');
undefined
> faker.date.past(1);
Wed Nov 12 2014 08:51:13 GMT+0000 (GMT)
> faker.date.past(1);
Tue Nov 12 2013 08:51:14 GMT+0000 (GMT)
> faker.date.past(1);
Tue Nov 12 2013 08:51:14 GMT+0000 (GMT)
> faker.date.past(1);
Tue Nov 12 2013 08:51:15 GMT+0000 (GMT)
> faker.date.past(1);
Wed Nov 12 2014 08:51:15 GMT+0000 (GMT)
> faker.date.past(1);
Tue Nov 12 2013 08:51:16 GMT+0000 (GMT)
> faker.date.past(1);
Wed Nov 12 2014 08:51:16 GMT+0000 (GMT)
```

With this pull request, you can get any past date:

```
$ node
> var faker = require('./');
undefined
> faker.date.past(1);
Sun Sep 28 2014 07:15:39 GMT+0100 (BST)
> faker.date.past(1);
Sat Nov 08 2014 21:57:32 GMT+0000 (GMT)
> faker.date.past(1);
Tue Oct 07 2014 20:47:25 GMT+0100 (BST)
> faker.date.past(1);
Fri Oct 17 2014 12:10:57 GMT+0100 (BST)
> faker.date.past(1);
Mon Jan 20 2014 10:44:57 GMT+0000 (GMT)
> faker.date.past(1);
Mon Sep 29 2014 07:48:30 GMT+0100 (BST)
> faker.date.past(1);
Thu Dec 26 2013 15:13:09 GMT+0000 (GMT)
```

Also, now you can call those functions without parameters, and N will take the default value of `1`.