* changing apm appLink * changing apm appLink * removing title from api * adding absolute and relative times * addressing pr comments * addressing pr comments * addressing pr comments * fixing TS issues * addressing pr comments Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
14 lines
442 B
TypeScript
14 lines
442 B
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
import datemath from '@elastic/datemath';
|
|
|
|
export function getAbsoluteTime(range: string, opts = {}) {
|
|
const parsed = datemath.parse(range, opts);
|
|
if (parsed) {
|
|
return parsed.valueOf();
|
|
}
|
|
}
|