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:
Hugo Häggmark
2019-05-08 13:51:44 +02:00
committed by GitHub
parent e7a9afe983
commit ceb9f0855b
86 changed files with 583 additions and 484 deletions

View File

@@ -1,8 +1,8 @@
import moment from 'moment';
import { MssqlDatasource } from '../datasource';
import { TemplateSrvStub, TimeSrvStub } from 'test/specs/helpers';
import { CustomVariable } from 'app/features/templating/custom_variable';
import q from 'q';
import { dateTime } from '@grafana/ui/src/utils/moment_wrapper';
describe('MSSQLDatasource', () => {
const ctx: any = {
@@ -29,8 +29,8 @@ describe('MSSQLDatasource', () => {
rawQuery: 'select time, text, tags from table;',
},
range: {
from: moment(1432288354),
to: moment(1432288401),
from: dateTime(1432288354),
to: dateTime(1432288401),
},
};
@@ -209,8 +209,8 @@ describe('MSSQLDatasource', () => {
},
};
const time = {
from: moment(1521545610656),
to: moment(1521546251185),
from: dateTime(1521545610656),
to: dateTime(1521546251185),
};
beforeEach(() => {