kibana/packages/kbn-timerange/README.md
Abdul Wahab Zahid e610f09b2b
[Dataset quality] Degraded docs insights in flyout (#176912)
The PR adds the Degraded Docs insights panel which shows the percentage
of degraded docs over time using Lens Embeddable.

<img width="621" alt="Screenshot 2024-02-14 at 13 25 19"
src="2ae421b1-bfae-44e2-8da5-a2063061d761">

<img width="981" alt="Screenshot 2024-02-14 at 13 15 33"
src="7d70cb6b-0d5a-4c7c-84f6-509eb12886d3">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-02-22 11:20:47 +01:00

591 B

@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' });