leverage cash when no dates passed in

This commit is contained in:
Eric Hulburd
2016-02-10 19:07:37 -06:00
parent c75ae9030c
commit 347507b148
3 changed files with 6 additions and 1 deletions

View File

@@ -12,6 +12,10 @@ export default class {
// returns array of array length two, representing mins and maxes not within min_max2.
static minusRange(min_max1, min_max2){
var minus = [];
// return undefined if min_max1 not provided
if (!min_max1 || (!min_max1[0] && !min_max2[1])) return undefined;
if (min_max1[0] >= min_max2[0]){
if (min_max1[1] > min_max2[1]) minus.push([min_max2[1], min_max1[1]]);
} else if (min_max1[1] <= min_max2[1]){