mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 14:22:48 +08:00

* added packages reference menu item. * removed the draft flag. * Updated docs by running script.
39 lines
1.1 KiB
Markdown
39 lines
1.1 KiB
Markdown
+++
|
|
# -----------------------------------------------------------------------
|
|
# 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.
|
|
|
|
<b>Signature</b>
|
|
|
|
```typescript
|
|
export declare function parseDateMath(mathString: string, time: any, roundUp?: boolean): DateTime | undefined;
|
|
```
|
|
<b>Import</b>
|
|
|
|
```typescript
|
|
import { dateMath } from '@grafana/data';
|
|
const { parseDateMath } = dateMath;
|
|
```
|
|
<b>Parameters</b>
|
|
|
|
| Parameter | Type | Description |
|
|
| --- | --- | --- |
|
|
| mathString | <code>string</code> | |
|
|
| time | <code>any</code> | |
|
|
| roundUp | <code>boolean</code> | If true it will round the time to endOf time unit, otherwise to startOf time unit. |
|
|
|
|
<b>Returns:</b>
|
|
|
|
`DateTime | undefined`
|
|
|