From 4600aac7d5240d09a9e0ea108eb47535de9ad25c Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 13 Mar 2019 22:31:54 -0700 Subject: [PATCH] set the unit on time data --- packages/grafana-ui/src/types/data.ts | 6 +++--- packages/grafana-ui/src/utils/processTableData.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/types/data.ts b/packages/grafana-ui/src/types/data.ts index d8d67809ed8..992e11690d5 100644 --- a/packages/grafana-ui/src/types/data.ts +++ b/packages/grafana-ui/src/types/data.ts @@ -51,9 +51,9 @@ export enum NullValueMode { export type TimeSeriesVMs = TimeSeriesVM[]; export interface Column { - text: string; // name - type?: 'time' | 'number' | 'string' | 'object'; - filterable?: boolean; + text: string; // The column name + type?: 'time' | 'number' | 'string' | 'object'; // not used anywhere? can we remove? + filterable?: boolean; // currently only set by elasticsearch, and used in the table panel unit?: string; } diff --git a/packages/grafana-ui/src/utils/processTableData.ts b/packages/grafana-ui/src/utils/processTableData.ts index 9f81635da20..d4a91efd622 100644 --- a/packages/grafana-ui/src/utils/processTableData.ts +++ b/packages/grafana-ui/src/utils/processTableData.ts @@ -139,6 +139,7 @@ function convertTimeSeriesToTableData(timeSeries: TimeSeries): TableData { { text: 'Time', type: 'time', + unit: 'dateTimeAsIso', }, ], rows: timeSeries.datapoints,