mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
Merge pull request #13138 from dataease/pr@dev-v2@fix_threshold_time
fix(X-Pack): 阈值告警-设置的时间控件与图表时间格式不一致
This commit is contained in:
@@ -362,9 +362,9 @@ public class ChartViewThresholdManage {
|
||||
}
|
||||
} else {
|
||||
if (timeFlag == 4) {
|
||||
return now.withDayOfMonth(1).format(formatter);
|
||||
return now.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).format(formatter);
|
||||
} else if (timeFlag == 5) {
|
||||
return now.plusMonths(1).withDayOfMonth(1).minusDays(1).format(formatter);
|
||||
return now.plusMonths(1).withDayOfMonth(1).minusDays(1).withHour(0).withMinute(0).withSecond(0).format(formatter);
|
||||
} else {
|
||||
return getCustomTimeValue(format, 3, suffix, count, true);
|
||||
}
|
||||
@@ -381,7 +381,9 @@ public class ChartViewThresholdManage {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String fullFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
int len = format.length();
|
||||
if (!hasTime) {
|
||||
if (hasTime) {
|
||||
now = now.withHour(0).withMinute(0).withSecond(0);
|
||||
} else {
|
||||
len = Math.min(len, 10);
|
||||
}
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(fullFormat.substring(0, len));
|
||||
|
||||
2
de-xpack
2
de-xpack
Submodule de-xpack updated: 15fd94f9b3...7d763d1a73
Reference in New Issue
Block a user