mirror of https://github.com/layui/layui
Merge branch 'main' into 2.x
commit
4294b53eb1
|
@ -1802,7 +1802,6 @@
|
||||||
// 重新选择或者第一次选择
|
// 重新选择或者第一次选择
|
||||||
index = 0;
|
index = 0;
|
||||||
that.endState = false;
|
that.endState = false;
|
||||||
that.endDate = {};
|
|
||||||
} else {
|
} else {
|
||||||
index = 1;
|
index = 1;
|
||||||
that.endState = true;
|
that.endState = true;
|
||||||
|
@ -1860,18 +1859,22 @@
|
||||||
if (that.endState && that.autoCalendarModel.auto) {
|
if (that.endState && that.autoCalendarModel.auto) {
|
||||||
isChange = that.autoCalendarModel();
|
isChange = that.autoCalendarModel();
|
||||||
}
|
}
|
||||||
if ((isChange || that.rangeLinked && that.endState) && that.newDate(that.startDate) > that.newDate(that.endDate)) {
|
// 判断是否反选
|
||||||
|
var needSwapDate = (isChange || that.rangeLinked && that.endState) && that.newDate(that.startDate) > that.newDate(that.endDate);
|
||||||
|
if (needSwapDate){
|
||||||
var isSameDate = that.startDate.year === that.endDate.year && that.startDate.month === that.endDate.month && that.startDate.date === that.endDate.date;
|
var isSameDate = that.startDate.year === that.endDate.year && that.startDate.month === that.endDate.month && that.startDate.date === that.endDate.date;
|
||||||
// 判断是否反选
|
var startDate;
|
||||||
var startDate = that.startDate;
|
// 如果是同一天并且出现了反选证明是时分秒出现开始时间大于结束时间的现象
|
||||||
that.startDate = lay.extend({}, that.endDate, isSameDate ? {} : that.startTime);
|
if(isSameDate){
|
||||||
|
startDate = that.startTime;
|
||||||
|
that.startTime = that.endTime;
|
||||||
|
that.endTime = startDate;
|
||||||
|
}
|
||||||
|
// 当出现反向选择时(即“后点击”的日期比“先点击”的日期小),重新提取区间
|
||||||
|
startDate = that.startDate;
|
||||||
|
that.startDate = lay.extend({}, that.endDate, that.startTime);
|
||||||
options.dateTime = lay.extend({}, that.startDate);
|
options.dateTime = lay.extend({}, that.startDate);
|
||||||
that.endDate = lay.extend({}, startDate, isSameDate ? {} : that.endTime);
|
that.endDate = lay.extend({}, startDate, that.endTime);
|
||||||
isSameDate && ( // 如果是同一天并且出现了反选证明是时分秒出现开始时间大于结束时间的现象
|
|
||||||
startDate = that.startTime,
|
|
||||||
that.startTime = that.endTime,
|
|
||||||
that.endTime = startDate
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
isChange && (options.dateTime = lay.extend({}, that.startDate));
|
isChange && (options.dateTime = lay.extend({}, that.startDate));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2967,6 +2967,9 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
|
|
||||||
// 插入内容
|
// 插入内容
|
||||||
vals.push(content);
|
vals.push(content);
|
||||||
|
}else if(item3.field && item3.type !== 'normal'){
|
||||||
|
// https://gitee.com/layui/layui/issues/I8PHCR
|
||||||
|
if(i1 == 0) fieldsIsHide[item3.field] = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue