Commit 0cfcc85d by Alexander Zobnin Committed by GitHub

fix dateMath import in grafana-ui (#21546)

parent 451e9bea
import React, { FormEvent, useState, useCallback } from 'react';
import { TIME_FORMAT, TimeZone, isDateTime, TimeRange, DateTime } from '@grafana/data';
import { TIME_FORMAT, TimeZone, isDateTime, TimeRange, DateTime, dateMath } from '@grafana/data';
import { stringToDateTimeType, isValidTimeString } from '../time';
import { mapStringsToTimeRange } from './mapper';
import { TimePickerCalendar } from './TimePickerCalendar';
import Forms from '../../Forms';
import { isMathString } from '@grafana/data/src/datetime/datemath';
interface Props {
isFullscreen: boolean;
......@@ -116,7 +115,7 @@ function valueAsString(value: DateTime | string): string {
}
function isValid(value: string, roundup?: boolean, timeZone?: TimeZone): boolean {
if (isMathString(value)) {
if (dateMath.isMathString(value)) {
return isValidTimeString(value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment