summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiero Blunda <pieroblunda@gmail.com>2015-09-21 15:43:20 -0300
committerPiero Blunda <pieroblunda@gmail.com>2015-09-21 15:43:20 -0300
commitbfe03d2531d5a44d83c78af8b77e87f169f4621e (patch)
tree472fc672664b7ba50163cf9863099896f0d9c189
parentf99ee4ce3b377fa8a2a9c78b571df8a0c39032d7 (diff)
downloadgit-hours-bfe03d2531d5a44d83c78af8b77e87f169f4621e.zip
git-hours-bfe03d2531d5a44d83c78af8b77e87f169f4621e.tar.gz
git-hours-bfe03d2531d5a44d83c78af8b77e87f169f4621e.tar.bz2
Using 4 spaces identation
-rwxr-xr-xindex.js56
-rw-r--r--test/test-functional.js70
2 files changed, 63 insertions, 63 deletions
diff --git a/index.js b/index.js
index d60f31a..066d912 100755
--- a/index.js
+++ b/index.js
@@ -121,33 +121,33 @@ function parseArgs() {
}
function parseSinceDate(options){
- var justNow, thisPeriod, paramDate;
- switch(options.since){
- case 'tonight':
- justNow = new Date();
- thisPeriod = new Date(justNow.getFullYear(), justNow.getMonth(), justNow.getUTCDate());
- config.since = thisPeriod;
- break;
- case 'yesterday':
- justNow = new Date();
- thisPeriod = new Date(justNow.getFullYear(), justNow.getMonth(), justNow.getUTCDate()-1);
- config.since = thisPeriod;
- break;
- case 'lastweek':
- justNow = new Date();
- thisPeriod = new Date(justNow.getFullYear(), justNow.getMonth(), justNow.getUTCDate()-7);
- config.since = thisPeriod;
- break;
- case 'always':
- break;
- default:
- paramDate = new Date(String(config.since));
- if(paramDate === undefined){
- config.since = 'always';
- }else{
- config.since = paramDate;
- }
- }
+ var justNow, thisPeriod, paramDate;
+ switch(options.since){
+ case 'tonight':
+ justNow = new Date();
+ thisPeriod = new Date(justNow.getFullYear(), justNow.getMonth(), justNow.getUTCDate());
+ config.since = thisPeriod;
+ break;
+ case 'yesterday':
+ justNow = new Date();
+ thisPeriod = new Date(justNow.getFullYear(), justNow.getMonth(), justNow.getUTCDate()-1);
+ config.since = thisPeriod;
+ break;
+ case 'lastweek':
+ justNow = new Date();
+ thisPeriod = new Date(justNow.getFullYear(), justNow.getMonth(), justNow.getUTCDate()-7);
+ config.since = thisPeriod;
+ break;
+ case 'always':
+ break;
+ default:
+ paramDate = new Date(String(config.since));
+ if(paramDate === undefined){
+ config.since = 'always';
+ }else{
+ config.since = paramDate;
+ }
+ }
}
function mergeDefaultsWithArgs(config) {
@@ -276,7 +276,7 @@ function getBranchCommits(branchLatestCommit) {
};
if(commitData.date > config.since || config.since === 'always'){
- commits.push(commitData);
+ commits.push(commitData);
}
});
diff --git a/test/test-functional.js b/test/test-functional.js
index 64f5cfa..d716e07 100644
--- a/test/test-functional.js
+++ b/test/test-functional.js
@@ -25,50 +25,50 @@ describe('git-hours', function() {
});
describe('Since option', function(){
- it('Should analyse since today', function(done) {
- exec('node index.js --since today', function(err, stdout, stderr) {
- assert.ifError(err);
- var work = JSON.parse(stdout);
- assert.strictEqual(typeof work.total.hours, 'number');
- done();
+ it('Should analyse since today', function(done) {
+ exec('node index.js --since today', function(err, stdout, stderr) {
+ assert.ifError(err);
+ var work = JSON.parse(stdout);
+ assert.strictEqual(typeof work.total.hours, 'number');
+ done();
+ });
});
- });
- it('Should analyse since yesterday', function(done) {
- exec('node index.js --since yesterday', function(err, stdout, stderr) {
- assert.ifError(err);
- var work = JSON.parse(stdout);
- assert.strictEqual(typeof work.total.hours, 'number');
- done();
+ it('Should analyse since yesterday', function(done) {
+ exec('node index.js --since yesterday', function(err, stdout, stderr) {
+ assert.ifError(err);
+ var work = JSON.parse(stdout);
+ assert.strictEqual(typeof work.total.hours, 'number');
+ done();
+ });
});
- });
- it('Should analyse since last week', function(done){
- exec('node index.js --since lastweek', function(err, stdout, stderr) {
- assert.ifError(err);
- var work = JSON.parse(stdout);
- assert.strictEqual(typeof work.total.hours, 'number');
- done();
+ it('Should analyse since last week', function(done){
+ exec('node index.js --since lastweek', function(err, stdout, stderr) {
+ assert.ifError(err);
+ var work = JSON.parse(stdout);
+ assert.strictEqual(typeof work.total.hours, 'number');
+ done();
+ });
});
- });
- it('Should analyse since a specific date', function(done){
- exec('node index.js --since 2015-01-01', function(err, stdout, stderr) {
- assert.ifError(err);
- var work = JSON.parse(stdout);
- assert.notEqual(work.total.hours, 0);
- done();
+ it('Should analyse since a specific date', function(done){
+ exec('node index.js --since 2015-01-01', function(err, stdout, stderr) {
+ assert.ifError(err);
+ var work = JSON.parse(stdout);
+ assert.notEqual(work.total.hours, 0);
+ done();
+ });
});
- });
- it('Should analyse as without param', function(done){
- exec('node index.js --since always', function(err, stdout, stderr) {
- assert.ifError(err);
- var work = JSON.parse(stdout);
- assert.equal(work.total.hours, totalHoursCount);
- done();
+ it('Should analyse as without param', function(done){
+ exec('node index.js --since always', function(err, stdout, stderr) {
+ assert.ifError(err);
+ var work = JSON.parse(stdout);
+ assert.equal(work.total.hours, totalHoursCount);
+ done();
+ });
});
- });
});