mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06: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,9 +1,9 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
import { QueryCtrl } from 'app/plugins/sdk';
|
||||
import moment from 'moment';
|
||||
import { defaultQuery } from './StreamHandler';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { dateTime } from '@grafana/ui/src/utils/moment_wrapper';
|
||||
|
||||
export class TestDataQueryCtrl extends QueryCtrl {
|
||||
static templateUrl = 'partials/query.editor.html';
|
||||
@@ -20,14 +20,14 @@ export class TestDataQueryCtrl extends QueryCtrl {
|
||||
|
||||
this.target.scenarioId = this.target.scenarioId || 'random_walk';
|
||||
this.scenarioList = [];
|
||||
this.newPointTime = moment();
|
||||
this.newPointTime = dateTime();
|
||||
this.selectedPoint = { text: 'Select point', value: null };
|
||||
}
|
||||
|
||||
getPoints() {
|
||||
return _.map(this.target.points, (point, index) => {
|
||||
return {
|
||||
text: moment(point[1]).format('MMMM Do YYYY, H:mm:ss') + ' : ' + point[0],
|
||||
text: dateTime(point[1]).format('MMMM Do YYYY, H:mm:ss') + ' : ' + point[0],
|
||||
value: index,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user