Skip to content

Commit 098c3fe

Browse files
authored
[ML] Fix relative time range for Change Point Detection (#154313)
## Summary Fixes support for relative time bounds ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
1 parent 3754d65 commit 098c3fe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { startWith } from 'rxjs';
1919
import type { Filter, Query } from '@kbn/es-query';
2020
import { usePageUrlState } from '@kbn/ml-url-state';
2121
import { useTimefilter, useTimeRangeUpdates } from '@kbn/ml-date-picker';
22-
import moment from 'moment';
2322
import { ES_FIELD_TYPES } from '@kbn/field-types';
2423
import { DEFAULT_AGG_FUNCTION } from './constants';
2524
import { useSplitFieldCardinality } from './use_split_field_cardinality';
@@ -238,8 +237,8 @@ export const ChangePointDetectionContextProvider: FC = ({ children }) => {
238237
mergedQuery.bool!.filter.push({
239238
range: {
240239
[dataView.timeFieldName!]: {
241-
from: moment(timeRange.from).valueOf(),
242-
to: moment(timeRange.to).valueOf(),
240+
from: timeRange.from,
241+
to: timeRange.to,
243242
},
244243
},
245244
});

0 commit comments

Comments
 (0)