diff --git a/src/css/layui.css b/src/css/layui.css index 12ba1d30..51ffc0ae 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -900,7 +900,7 @@ a cite{font-style: normal; *cursor:pointer;} /* 小表格 */ .layui-table[lay-size="sm"] th, .layui-table[lay-size="sm"] td{padding-top: 5px; padding-right: 10px; padding-bottom: 5px; padding-left: 10px; font-size: 12px;} -.layui-table-view .layui-table[lay-size="sm"] .layui-table-cell{height: 30px; line-height: 20px; padding-top: 5px; padding-right: 5px;} +.layui-table-view .layui-table[lay-size="sm"] .layui-table-cell{height: 30px; line-height: 20px; padding-top: 5px; padding-left: 5px; padding-right: 5px;} /* 数据表格 */ .layui-table[lay-data]{display: none;} diff --git a/src/modules/laydate.js b/src/modules/laydate.js index 72f2ec8a..bfa37af6 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -302,9 +302,9 @@ year: tDate.getFullYear() ,month: tDate.getMonth() ,date: tDate.getDate() - ,hours: '23' - ,minutes: '59' - ,seconds: '59' + ,hours: i ? 23 : 0 + ,minutes: i ? 59 : 0 + ,seconds: i ? 59 : 0 }).getTime() ,STAMP = 86400000 //代表一天的毫秒数 ,thisDate = new Date( @@ -774,16 +774,20 @@ //如果当前日期不在设定的最大小日期区间,则自动纠正在可选区域 //校验主面板是否在可选日期区间 + var minMaxError; if(that.getDateTime(dateTime) > that.getDateTime(options.max)){ //若超出最大日期 dateTime = options.dateTime = lay.extend({}, options.max); + minMaxError = true; } else if(that.getDateTime(dateTime) < that.getDateTime(options.min)){ //若少于最小日期 dateTime = options.dateTime = lay.extend({}, options.min); + minMaxError = true; } //校验右侧面板是否在可选日期区间 if(options.range){ if(that.getDateTime(that.endDate) < that.getDateTime(options.min) || that.getDateTime(that.endDate) > that.getDateTime(options.max)){ that.endDate = lay.extend({}, options.max); + minMaxError = true; } // 有时间范围的情况下初始化startTime和endTime that.startTime = { @@ -797,7 +801,10 @@ seconds: that.endDate.seconds, } } - + + //初始值不在最大最小范围内 + minMaxError && that.setValue(that.parse()).hint('初始值' + lang.invalidDate + lang.formatError[1]); + fn && fn(); return that; }; diff --git a/src/modules/table.js b/src/modules/table.js index 0e301342..25cd0f60 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -154,7 +154,7 @@ layui.define(['laytpl', 'laypage', 'form', 'util'], function(exports){ return ''; }() ,'{{# var isSort = !(item2.colGroup) && item2.sort; }}' - ,'