kibana/packages/kbn-timerange
Luke Elmers b6287708f6
Adds AGPL 3.0 license (#192025)
Updates files outside of x-pack to be triple-licensed under Elastic
License 2.0, AGPL 3.0, or SSPL 1.0.
2024-09-06 19:02:41 -06:00
..
src Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
index.ts Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
jest.config.js Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kibana.jsonc
package.json Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
README.md [Dataset quality] Degraded docs insights in flyout (#176912) 2024-02-22 11:20:47 +01:00
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' });