[Maps] Add date-fields to metrics selection (#62629)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Nathan Reese 2020-04-08 10:03:37 -06:00 committed by GitHub
parent 90e6f2ca6d
commit 2023663104
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,8 +24,13 @@ function filterFieldsForAgg(fields, aggType) {
return getTermsFields(fields);
}
const metricAggFieldTypes = ['number'];
if (aggType !== AGG_TYPE.SUM) {
metricAggFieldTypes.push('date');
}
return fields.filter(field => {
return field.aggregatable && field.type === 'number';
return field.aggregatable && metricAggFieldTypes.includes(field.type);
});
}