mirror of
https://github.com/elastic/kibana.git
synced 2025-04-21 08:19:33 -04:00
Updates files outside of x-pack to be triple-licensed under Elastic License 2.0, AGPL 3.0, or SSPL 1.0. |
||
---|---|---|
.. | ||
src | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/timerange
This package shares a set of utilities for working with timeranges.
Utils
getDateRange
This function return a timestamp for startDate
and endDate
of a given date range.
import { getDateRange } from '@kbn/timerange';
const { startDate, endDate } = getDateRange({ from: 'now-24h', to: 'now' });
getDateISORange
This function return an ISO string for startDate
and endDate
of a given date range.
import { getDateISORange } from '@kbn/timerange';
const { startDate, endDate } = getDateISORange({ from: 'now-24h', to: 'now' });