mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Use two weeks before now for default start time in job start date picker (#155312)
When starting an anomaly detection job, if you select "Specify start time", the time chosen is two weeks before now, rounded down to the start of the day. <img width="917" alt="image" src="https://user-images.githubusercontent.com/22172091/233178339-1e198068-aa8b-479a-92cb-085fc34691e0.png"> Fixes https://github.com/elastic/enhancements/issues/16467
This commit is contained in:
parent
d8fa5d6831
commit
2d576c575e
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,7 @@ export class TimeRangeSelector extends Component {
|
|||
};
|
||||
this.latestTimestamp = this.props.startTime;
|
||||
this.now = this.props.now;
|
||||
this.twoWeeksAgo = moment(this.now).subtract(2, 'weeks').startOf('day');
|
||||
}
|
||||
|
||||
setStartTab = (tab) => {
|
||||
|
@ -38,6 +39,9 @@ export class TimeRangeSelector extends Component {
|
|||
case 1:
|
||||
this.setStartTime(this.now);
|
||||
break;
|
||||
case 2:
|
||||
this.setStartTime(this.twoWeeksAgo);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue