mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
15 lines
599 B
TypeScript
15 lines
599 B
TypeScript
import {normalizeDateTimeParams} from 'sentry/components/organizations/pageFilters/parse';
|
|
import type {PageFilters} from 'sentry/types';
|
|
import {getDateFilters} from 'sentry/views/starfish/utils/getDateFilters';
|
|
|
|
export const getDateConditions = (
|
|
selection: PageFilters
|
|
): {end?: string | undefined; start?: string | undefined; statsPeriod?: string} => {
|
|
const {startTime, endTime, statsPeriod} = getDateFilters(selection);
|
|
const {start, end} = normalizeDateTimeParams({
|
|
start: startTime.toDate(),
|
|
end: endTime.toDate(),
|
|
});
|
|
return statsPeriod ? {statsPeriod} : {start, end};
|
|
};
|