diff --git a/public/app/features/inspector/utils/download.test.ts b/public/app/features/inspector/utils/download.test.ts index bb8a68dd05f..7294ded12fe 100644 --- a/public/app/features/inspector/utils/download.test.ts +++ b/public/app/features/inspector/utils/download.test.ts @@ -1,14 +1,6 @@ import saveAs from 'file-saver'; -import { - dataFrameFromJSON, - DataFrameJSON, - dateTimeFormat, - dateTimeFormatISO, - FieldType, - LogRowModel, - LogsMetaKind, -} from '@grafana/data'; +import { dataFrameFromJSON, DataFrameJSON, dateTimeFormat, FieldType, LogRowModel, LogsMetaKind } from '@grafana/data'; import { downloadAsJson, downloadDataFrameAsCsv, downloadLogsModelAsTxt } from './download'; @@ -98,7 +90,7 @@ describe('inspector download', () => { rows: [{ timeEpochMs: 100, entry: 'testEntry' } as unknown as LogRowModel], }, 'test', - `testLabel: 1\nsecondTestLabel: 2\n\n\n${dateTimeFormatISO(100)}\ttestEntry\n`, + `testLabel: 1\nsecondTestLabel: 2\n\n\n${dateTimeFormat(100, { defaultWithMS: true })}\ttestEntry\n`, ], ])('should, when logsModel is %s and title is %s, resolve in %s', async (logsModel, title, expected) => { downloadLogsModelAsTxt(logsModel, title); diff --git a/public/app/features/inspector/utils/download.ts b/public/app/features/inspector/utils/download.ts index 23f76673b95..92f5f80150e 100644 --- a/public/app/features/inspector/utils/download.ts +++ b/public/app/features/inspector/utils/download.ts @@ -5,7 +5,6 @@ import { DataFrame, DataTransformerID, dateTimeFormat, - dateTimeFormatISO, LogsModel, MutableDataFrame, toCSV, @@ -31,7 +30,7 @@ export function downloadLogsModelAsTxt(logsModel: Pick { - const newRow = dateTimeFormatISO(row.timeEpochMs) + '\t' + row.entry + '\n'; + const newRow = dateTimeFormat(row.timeEpochMs, { defaultWithMS: true }) + '\t' + row.entry + '\n'; textToDownload = textToDownload + newRow; });