mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Display alert's 'Created' time in local time instead of UTC (#54414)
Signed-off-by: Michael Musenbrock <michael.musenbrock@gmail.com> Signed-off-by: Michael Musenbrock <michael.musenbrock@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a4b86a194d
commit
78833b4a47
@@ -345,8 +345,8 @@ describe('RuleList', () => {
|
||||
const instanceRows = byTestId('row').getAll(instancesTable);
|
||||
expect(instanceRows).toHaveLength(2);
|
||||
|
||||
expect(instanceRows![0]).toHaveTextContent('Firingfoo=barseverity=warning2021-03-18 13:47:05');
|
||||
expect(instanceRows![1]).toHaveTextContent('Firingfoo=bazseverity=error2021-03-18 13:47:05');
|
||||
expect(instanceRows![0]).toHaveTextContent('Firingfoo=barseverity=warning2021-03-18 08:47:05');
|
||||
expect(instanceRows![1]).toHaveTextContent('Firingfoo=bazseverity=error2021-03-18 08:47:05');
|
||||
|
||||
// expand details of an instance
|
||||
await userEvent.click(ui.ruleCollapseToggle.get(instanceRows![0]));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { FC, useMemo } from 'react';
|
||||
|
||||
import { dateTime } from '@grafana/data';
|
||||
import { Alert, PaginationProps } from 'app/types/unified-alerting';
|
||||
|
||||
import { alertInstanceKey } from '../../utils/rules';
|
||||
@@ -59,7 +60,7 @@ const columns: AlertTableColumnProps[] = [
|
||||
label: 'Created',
|
||||
// eslint-disable-next-line react/display-name
|
||||
renderCell: ({ data: { activeAt } }) => (
|
||||
<>{activeAt.startsWith('0001') ? '-' : activeAt.slice(0, 19).replace('T', ' ')}</>
|
||||
<>{activeAt.startsWith('0001') ? '-' : dateTime(activeAt).format('YYYY-MM-DD HH:mm:ss')}</>
|
||||
),
|
||||
size: '150px',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user