Skip to content

Commit

Permalink
Merge pull request #89 from edshadi/fix-date-recent-bug
Browse files Browse the repository at this point in the history
fixed date.recent() bug
  • Loading branch information
FotoVerite committed Jul 22, 2014
2 parents daa95b3 + 8b894a0 commit a4f7954
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var date = {
recent: function (days) {
var date = new Date();
var future = date.getTime();
future -= Faker.random.number(days) * 3600 * 1000; // some time from now to N days ago, in milliseconds
future -= Faker.random.number(days) * 24 * 60 * 60 * 1000; // some time from now to N days ago, in milliseconds
date.setTime(future)

return date.toJSON();
Expand Down
2 changes: 1 addition & 1 deletion test/date.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("date.js", function () {

var date = Faker.Date.recent(30);

assert.ok(Date.parse(date) < new Date());
assert.ok(Date.parse(date) <= new Date());
});

});
Expand Down

0 comments on commit a4f7954

Please sign in to comment.