I have two number range. Lets say 1st rage is 6-9 and second is 1-15
I need to check that if it is conflicting. I mean if 1-15 is crossing 6-9, Valid ranges are 1-5, 10-15 but 1-15, 2-18 like this should return me that it is violating 6-9.
Currently I am checking only signle digit if it falls between range,
if (typeof (Number.prototype.isBetween) === "undefined") {
Number.prototype.isBetween = function (min, max, notBoundaries) {
var between = false;
if (notBoundaries) {
if ((this < max) && (this > min)) between = true;
alert('notBoundaries');
} else {
if ((this <= max) && (this >= min)) between = true;
alert('Boundaries');
}
alert('here');
return between;
}
}
But now I need to check range. Any help is appreciated
a to b... you need to check ifais within the test range ORbis within the test range OR (ais below the test range ANDbis above the test range) ... does that help?