The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/docs/sources/packages_api/data/datemath/parsedatemath.md

1.1 KiB

+++

-----------------------------------------------------------------------

Do not edit this file. It is automatically generated by API Documenter.

-----------------------------------------------------------------------

title = "parseDateMath" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" +++

dateMath.parseDateMath() function

dateMath.parseDateMath() function

Parses math part of the time string and shifts supplied time according to that math. See unit tests for examples.

Signature

export declare function parseDateMath(mathString: string, time: any, roundUp?: boolean): DateTime | undefined;

Import

import { dateMath } from '@grafana/data';
const { parseDateMath } = dateMath;

Parameters

Parameter Type Description
mathString string
time any
roundUp boolean If true it will round the time to endOf time unit, otherwise to startOf time unit.

Returns:

DateTime | undefined