dateMath.isValid() function

dateMath.isValid() function

Checks if text is a valid date which in this context means that it is either a Moment instance or it can be parsed by parse function. See parse function to see what is considered acceptable.

Signature

  1. export declare function isValid(text: string | DateTime): boolean;

Import

  1. import { dateMath } from '@grafana/data';
  2. const { isValid } = dateMath;

Parameters

ParameterTypeDescription
textstring | DateTime

Returns:

boolean