Merge pull request #1197 from sunxiaobin89/main

修复表单和日期选择的一些小问题
pull/1198/head
贤心 2023-01-31 11:03:40 +08:00 committed by GitHub
commit 6501ab2715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -652,10 +652,15 @@ layui.define(['lay', 'layer', 'util'], function(exports){
checks.each(function(index, check){ checks.each(function(index, check){
var othis = $(this); var othis = $(this);
var skin = othis.attr('lay-skin') || 'primary'; var skin = othis.attr('lay-skin') || 'primary';
check.title || (check.title = othis.attr('lay-text') || ''); // 向下兼容将以前设置在lay-text的值赋给title
var title = (check.title.replace(/\s/g, '') || '').split('|'); var title = (check.title.replace(/\s/g, '') || '').split('|');
var disabled = this.disabled; var disabled = this.disabled;
if(skin === 'switch') skin = '_'+ skin; if(skin === 'switch') {
skin = '_'+ skin;
} else if (skin !== 'tag') {
skin = 'primary';
}
var RE_CLASS = CLASS[skin] || CLASS.checkbox; var RE_CLASS = CLASS[skin] || CLASS.checkbox;
if(typeof othis.attr('lay-ignore') === 'string') return othis.show(); if(typeof othis.attr('lay-ignore') === 'string') return othis.show();

View File

@ -967,6 +967,11 @@
minutes: that.endDate.minutes, minutes: that.endDate.minutes,
seconds: that.endDate.seconds, seconds: that.endDate.seconds,
} }
// 如果是年月范围将对应的日期统一成当月的1日进行比较避免出现同一个月但是开始日期大于结束日期的情况
if (options.type === 'month') {
options.dateTime.date = 1;
that.endDate.date = 1;
}
} }
// 初始值不在最大最小范围内 // 初始值不在最大最小范围内