参考 改造一下
fvs开始日期和结束日期控件,时间相差如果小于6个月弹窗提示 - 我的帆软
如果是一个区间控件,在编辑后事件写JS判断一下
function checkDateRange() {
const range = this.getValue(); // 获取控件值(格式如["2025-08-01", "2025-08-05"])
const start = new Date(range[0]);
const end = new Date(range[1]);
const diffDays = (end - start) / (1000 * 60 * 60 * 24);
if (diffDays > 7) {
this.setValue([range[0], new Date(start.setDate(start.getDate() + 7))]); // 自动修正为7天后
FR.Msg.toast("日期间隔不能超过7天,已自动调整");
}
}