Skip to content

Commit 160656f

Browse files
authored
Merge pull request #1258 from xieliuduo/dev29-hotFix-date
hotfix: board rangeTime filter display
2 parents a56dea3 + 6070138 commit 160656f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

frontend/src/app/pages/DashBoardPage/utils/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ export const getControllerDateValues = (obj: {
302302
timeValues[0] = time.format(TIME_FORMATTER);
303303
}
304304
if (endTime) {
305+
//end 精确时间
305306
if (endTime.relativeOrExact === TimeFilterValueCategory.Exact) {
306307
timeValues[1] = endTime.exactValue as string;
307308
if (obj.execute) {
@@ -313,9 +314,12 @@ export const getControllerDateValues = (obj: {
313314
timeValues[1] = endTime.exactValue as string;
314315
}
315316
} else {
317+
// end 相对时间
316318
const { amount, unit, direction } = endTime.relativeValue!;
317-
const time = getTime(+(direction + amount), unit)(unit, false);
319+
const isStart = !obj.execute;
320+
const time = getTime(+(direction + amount), unit)(unit, isStart);
318321
timeValues[1] = time.format(TIME_FORMATTER);
322+
debugger;
319323
}
320324
}
321325

frontend/src/app/utils/time.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function getTime(
4040
amount?: number | string,
4141
unit?: unitOfTime.DurationConstructor,
4242
): (unitTime, isStart?: boolean) => Moment {
43-
return (unitOfTime: unitOfTime.StartOf, isStart) => {
43+
return (unitOfTime: unitOfTime.StartOf, isStart?: boolean) => {
4444
if (!!isStart) {
4545
return moment().add(amount, unit).startOf(unitOfTime);
4646
}

0 commit comments

Comments
 (0)