Permalink
Browse files

toggl was sometimes returning negative values

  • Loading branch information...
Swizec committed Jun 7, 2012
1 parent 785f598 commit db278b87e9d69b28526ca8208713189da49f8c02
Showing with 3 additions and 3 deletions.
  1. +3 −2 fetching/toggl.js
  2. +0 −1 fetching/toshl.js
View
@@ -77,8 +77,9 @@ var parse_data = function (data) {
years.push(year);
}
_data[key] = data[key].map(
- function (a) {return income(a);}).reduce(
- function (a,b) {return a+b;});
+ function (a) {return income(a);}).filter(
+ function (a) {return a>=0;}).reduce(
+ function (a,b) {return a+b;}, 0);
});
Callback(_data);
View
@@ -108,7 +108,6 @@ var parse = function () {
})
.on('end', function () {
parsed = fix_data(parsed);
- console.log(parsed);
Callback(parsed);

0 comments on commit db278b8

Please sign in to comment.