[Maps] fix tooltips with timestamp appear as epoch (#95106)
* [Maps] fix tooltips with timestamp appear as epoch * request dates as strict_date_optional_time for tooltips
This commit is contained in:
parent
bfe6c5186c
commit
71466b2dd0
|
@ -71,7 +71,8 @@ export interface ScriptField {
|
|||
|
||||
function getDocValueAndSourceFields(
|
||||
indexPattern: IndexPattern,
|
||||
fieldNames: string[]
|
||||
fieldNames: string[],
|
||||
dateFormat: string
|
||||
): {
|
||||
docValueFields: Array<string | { format: string; field: string }>;
|
||||
sourceOnlyFields: string[];
|
||||
|
@ -94,7 +95,7 @@ function getDocValueAndSourceFields(
|
|||
field.type === 'date'
|
||||
? {
|
||||
field: fieldName,
|
||||
format: 'epoch_millis',
|
||||
format: dateFormat,
|
||||
}
|
||||
: fieldName;
|
||||
docValueFields.push(docValueField);
|
||||
|
@ -277,7 +278,8 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye
|
|||
|
||||
const { docValueFields, sourceOnlyFields, scriptFields } = getDocValueAndSourceFields(
|
||||
indexPattern,
|
||||
searchFilters.fieldNames
|
||||
searchFilters.fieldNames,
|
||||
'epoch_millis'
|
||||
);
|
||||
const topHits: {
|
||||
size: number;
|
||||
|
@ -373,7 +375,8 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye
|
|||
|
||||
const { docValueFields, sourceOnlyFields } = getDocValueAndSourceFields(
|
||||
indexPattern,
|
||||
searchFilters.fieldNames
|
||||
searchFilters.fieldNames,
|
||||
'epoch_millis'
|
||||
);
|
||||
|
||||
const initialSearchContext = { docvalue_fields: docValueFields }; // Request fields in docvalue_fields insted of _source
|
||||
|
@ -498,7 +501,8 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye
|
|||
|
||||
const { docValueFields } = getDocValueAndSourceFields(
|
||||
indexPattern,
|
||||
this._getTooltipPropertyNames()
|
||||
this._getTooltipPropertyNames(),
|
||||
'strict_date_optional_time'
|
||||
);
|
||||
|
||||
const initialSearchContext = { docvalue_fields: docValueFields }; // Request fields in docvalue_fields insted of _source
|
||||
|
@ -704,7 +708,8 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye
|
|||
|
||||
const { docValueFields, sourceOnlyFields } = getDocValueAndSourceFields(
|
||||
indexPattern,
|
||||
searchFilters.fieldNames
|
||||
searchFilters.fieldNames,
|
||||
'epoch_millis'
|
||||
);
|
||||
|
||||
const initialSearchContext = { docvalue_fields: docValueFields }; // Request fields in docvalue_fields insted of _source
|
||||
|
|
Loading…
Reference in a new issue