Move getBinEnd function to a class method
This commit is contained in:
parent
392e004879
commit
49a60caffc
@ -380,7 +380,7 @@ module.exports = class Histogram extends BaseWidget {
|
||||
_query: _query,
|
||||
_column: _column,
|
||||
_start: this.getBinStart(override),
|
||||
_end: getBinEnd(override)
|
||||
_end: this.getBinEnd(override)
|
||||
});
|
||||
|
||||
binsQuery = [
|
||||
@ -494,7 +494,7 @@ module.exports = class Histogram extends BaseWidget {
|
||||
_column: _column,
|
||||
_aggregation: _aggregation,
|
||||
_start: this.getBinStart(override),
|
||||
_end: getBinEnd(override),
|
||||
_end: this.getBinEnd(override),
|
||||
_offset: parseOffset(_offset, _aggregation)
|
||||
});
|
||||
} else {
|
||||
@ -686,6 +686,14 @@ module.exports = class Histogram extends BaseWidget {
|
||||
|
||||
return binStart;
|
||||
}
|
||||
|
||||
getBinEnd (override) {
|
||||
if (override.hasOwnProperty('start') && override.hasOwnProperty('end')) {
|
||||
return Math.max(override.start, override.end);
|
||||
}
|
||||
return override.end || 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var DATE_AGGREGATIONS = {
|
||||
@ -699,13 +707,6 @@ var DATE_AGGREGATIONS = {
|
||||
'year': true
|
||||
};
|
||||
|
||||
function getBinEnd(override) {
|
||||
if (override.hasOwnProperty('start') && override.hasOwnProperty('end')) {
|
||||
return Math.max(override.start, override.end);
|
||||
}
|
||||
return override.end || 0;
|
||||
}
|
||||
|
||||
function getBinsCount(override) {
|
||||
return override.bins || 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user