Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Commit

Permalink
Fixed test 3 failing when day subtracted by 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samrith Shankar committed May 28, 2017
1 parent 1d4311b commit 90233c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README.md
Expand Up @@ -21,7 +21,7 @@ console.log(relativeDate(new Date()).text);
console.log(relativeDate(moment().subtract(1,'day')).text);
//Output: Yesterday

console.log(relativeDate(moment().subtract(Math.floor(Math.random() * 7) + 1, 'd')).text);
console.log(relativeDate(moment().subtract(Math.floor(Math.random() * 6) + 2, 'd')).text);
//Output: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday

console.log(relativeDate(moment(new Date()).subtract(8, 'd')).text);
Expand Down Expand Up @@ -67,10 +67,11 @@ There is an `.editorconfig` to maintain indentation across editors. Feel free to
- Option to show texts like, 'just now', 'about a minute', etc.

## Release History
- 1.0.6 - Completed comprehensive readme
- 1.0.5 - Added returned object structure in readme
- 1.0.4 - Added feature roadmap
- 1.0.3 - Changed license of NPM package to MIT
- 1.0.2 - Completed readme
- 1.0.1 - Added `.editorconfig`
- 1.0.0 - Initial release
- 1.0.7 - Rectified test case 3 failing when randomiser subtracts day by 1. Changed the randomisation formula to generate number between 6 and 2
- 1.0.6 - Completed comprehensive readme.
- 1.0.5 - Added returned object structure in readme.
- 1.0.4 - Added feature roadmap.
- 1.0.3 - Changed license of NPM package to MIT.
- 1.0.2 - Completed readme.
- 1.0.1 - Added `.editorconfig`.
- 1.0.0 - Initial release.
2 changes: 1 addition & 1 deletion test/test.js
Expand Up @@ -26,7 +26,7 @@ describe('#RelativeDate', function() {
});

it(tests[3], function() {
var result = RelativeDate(moment().subtract(Math.floor(Math.random() * 7) + 1, 'd')).text;
var result = RelativeDate(moment().subtract(Math.floor(Math.random() * 6) + 2, 'd')).text;
result.should.match(/Monday||Tuesday||Wednesday||Thursday||Friday||Saturday||Sunday/g);
});

Expand Down

0 comments on commit 90233c3

Please sign in to comment.