mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-06-29 12:47:35 +00:00
refactor
This commit is contained in:
parent
b0f21d4d14
commit
ab367dbf2b
@ -376,13 +376,10 @@ limitations under the License. -->
|
||||
flag = tf(props.value, format) === tf(time, format);
|
||||
}
|
||||
classObj[`${state.pre}-date`] = true;
|
||||
classObj[`${state.pre}-date-disabled`] =
|
||||
(props.right && (t < start.value || t > maxEnd.value || !props.maxRange?.length)) ||
|
||||
(props.left && t < minStart.value) ||
|
||||
t > end.value ||
|
||||
!props.maxRange?.length ||
|
||||
t > maxEnd.value ||
|
||||
props.disabledDate(time, format);
|
||||
const rightDisabled = props.right && (t < start.value || t > maxEnd.value || !props.maxRange?.length);
|
||||
const leftDisabled =
|
||||
props.left && (t < minStart.value || t > end.value || !props.maxRange?.length || t > maxEnd.value);
|
||||
classObj[`${state.pre}-date-disabled`] = rightDisabled || leftDisabled || props.disabledDate(time, format);
|
||||
classObj[`${state.pre}-date-on`] = (props.left && t > start.value) || (props.right && t < end.value);
|
||||
classObj[`${state.pre}-date-selected`] = flag;
|
||||
return classObj;
|
||||
|
@ -245,13 +245,16 @@ limitations under the License. -->
|
||||
if (minute === -1 || hour === -1 || day === -1) {
|
||||
return appStore.setMaxRange([]);
|
||||
}
|
||||
if (!day) {
|
||||
return appStore.setMaxRange([]);
|
||||
}
|
||||
const gap = dayToMS(day) + hour * 60 * 60 * 1000 + minute * 60 * 1000;
|
||||
const dates: Date[] = [new Date(new Date().getTime() - gap), new Date()];
|
||||
appStore.setMaxRange(dates);
|
||||
}
|
||||
|
||||
function dayToMS(day: number) {
|
||||
return (day + 1) * 24 * 60 * 60 * 1000;
|
||||
return day * 24 * 60 * 60 * 1000;
|
||||
}
|
||||
|
||||
function getNavPaths() {
|
||||
|
Loading…
Reference in New Issue
Block a user