mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 14:23:03 +08:00
Chore: Replaces moment with Grafanas DateTime (#16919)
* Wip: Initial commit * Refactor: Replaces moment.utc( * Refactor: replaces the last isMoment statements * Refactor: Removes almost all moment imports * Refactor: Moves moment_wrapper to grafana/ui * Refactor: Renames momentWrapper * Refactor: Removes one more moment import * Refactor: Removes unitOfTime import * Fix: Fixes Prettier error * Refactor: Renames DateTimeType to DateTime * Refactor: Renames isDateTimeType to isDateTime * Refactor: Renames dateTime to dateTime * Feature: Bans moment imports and types
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import moment from 'moment';
|
||||
import { PostgresDatasource } from '../datasource';
|
||||
import { CustomVariable } from 'app/features/templating/custom_variable';
|
||||
import { toUtc, dateTime } from '@grafana/ui/src/utils/moment_wrapper';
|
||||
|
||||
describe('PostgreSQLDatasource', () => {
|
||||
const instanceSettings = { name: 'postgresql' };
|
||||
@ -10,8 +10,8 @@ describe('PostgreSQLDatasource', () => {
|
||||
replace: jest.fn(text => text),
|
||||
};
|
||||
const raw = {
|
||||
from: moment.utc('2018-04-25 10:00'),
|
||||
to: moment.utc('2018-04-25 11:00'),
|
||||
from: toUtc('2018-04-25 10:00'),
|
||||
to: toUtc('2018-04-25 11:00'),
|
||||
};
|
||||
const ctx = {
|
||||
backendSrv,
|
||||
@ -39,8 +39,8 @@ describe('PostgreSQLDatasource', () => {
|
||||
rawQuery: 'select time, title, text, tags from table;',
|
||||
},
|
||||
range: {
|
||||
from: moment(1432288354),
|
||||
to: moment(1432288401),
|
||||
from: dateTime(1432288354),
|
||||
to: dateTime(1432288401),
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user