Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
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, fiscalYearStartMonth?: number): 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. |
fiscalYearStartMonth | number |
Returns:
DateTime | undefined