|
@@ -1,7 +1,6 @@
|
|
|
import moment from 'moment';
|
|
|
|
|
|
import ConfigStore from 'sentry/stores/configStore';
|
|
|
-import type {DateString} from 'sentry/types/core';
|
|
|
|
|
|
import type {TableDataRow} from './discover/discoverQuery';
|
|
|
|
|
@@ -184,23 +183,6 @@ export function getStartOfPeriodAgo(
|
|
|
return getStartOfDay(getPeriodAgo(period, unit));
|
|
|
}
|
|
|
|
|
|
-export function statsPeriodToDays(
|
|
|
- statsPeriod?: string | null,
|
|
|
- start?: DateString,
|
|
|
- end?: DateString
|
|
|
-) {
|
|
|
- if (statsPeriod?.endsWith('d')) {
|
|
|
- return parseInt(statsPeriod.slice(0, -1), 10);
|
|
|
- }
|
|
|
- if (statsPeriod?.endsWith('h')) {
|
|
|
- return parseInt(statsPeriod.slice(0, -1), 10) / 24;
|
|
|
- }
|
|
|
- if (start && end) {
|
|
|
- return (new Date(end).getTime() - new Date(start).getTime()) / (24 * 60 * 60 * 1000);
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* Does the user prefer a 24 hour clock?
|
|
|
*/
|