Skip to content

Commit

Permalink
add comment about docvalue for date fields in getComputedFields (#25725)
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese authored Nov 19, 2018
1 parent 7086388 commit 0958e1d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ui/public/index_patterns/_get_computed_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
*/

import _ from 'lodash';
// Takes a hit, merges it with any stored/scripted fields, and with the metaFields
// returns a flattened version

export function getComputedFields() {
const self = this;
const scriptFields = {};
let docvalueFields = [];

// Date value returned in "_source" could be in any number of formats
// Use a docvalue for each date field to ensure standardized formats when working with date fields
// indexPattern.flattenHit will override "_source" values when the same field is also defined in "fields"
docvalueFields = _.reject(self.fields.byType.date, 'scripted')
.map((dateField) => {
return {
Expand Down

0 comments on commit 0958e1d

Please sign in to comment.