mirror of https://github.com/layui/laydate
5.0.2
parent
8245d17a4d
commit
5afb50f934
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
|
||||
@Name : layDate 5.0.1 日期时间控件
|
||||
@Name : layDate 5.0.2 日期时间控件
|
||||
@Author: 贤心
|
||||
@Site:http://www.layui.com/laydate/
|
||||
@License:MIT
|
||||
|
@ -55,7 +55,7 @@
|
|||
}
|
||||
|
||||
,laydate = {
|
||||
v: '5.0.1'
|
||||
v: '5.0.2'
|
||||
,config: {} //全局配置项
|
||||
,index: (window.laydate && window.laydate.v) ? 100000 : 0
|
||||
,path: ready.getPath
|
||||
|
@ -874,6 +874,12 @@
|
|||
if(typeof value === 'string'){
|
||||
value = value.replace(/\s+/g, ' ').replace(/^\s|\s$/g, '');
|
||||
}
|
||||
|
||||
//如果点击了开始,单未选择结束就关闭,则重新选择开始
|
||||
if(that.startState && !that.endState){
|
||||
delete that.startState;
|
||||
that.endState = true;
|
||||
};
|
||||
|
||||
if(typeof value === 'string' && value){
|
||||
if(that.EXP_IF.test(value)){ //校验日期格式
|
||||
|
@ -894,7 +900,7 @@
|
|||
) + '<br>已为你重置');
|
||||
error = true;
|
||||
}
|
||||
} else if(typeof value === 'object'){
|
||||
} else if(value && value.constructor === Date){ //如果值为日期对象时
|
||||
options.dateTime = that.systemDate(value);
|
||||
} else {
|
||||
options.dateTime = that.systemDate();
|
||||
|
@ -1587,7 +1593,9 @@
|
|||
,confirm: function(){
|
||||
if(options.range){
|
||||
if(!that.endDate) return that.hint('请先选择日期范围');
|
||||
if(lay(btn).hasClass(DISABLED)) return;
|
||||
if(lay(btn).hasClass(DISABLED)) return that.hint(
|
||||
options.type === 'time' ? TIPS_OUT.replace(/日期/g, '时间') : TIPS_OUT
|
||||
);
|
||||
} else {
|
||||
if(lay(btn).hasClass(DISABLED)) return that.hint('不在有效日期或时间范围内');
|
||||
}
|
||||
|
@ -1763,8 +1771,8 @@
|
|||
that.remove();
|
||||
}).on('keydown', function(e){
|
||||
if(e.keyCode === 13){
|
||||
e.preventDefault();
|
||||
if(lay('#'+ that.elemID)[0] && that.elemID === Class.thisElem){
|
||||
e.preventDefault();
|
||||
lay(that.footer).find(ELEM_CONFIRM)[0].click();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
|||
.laydate-time-list p{position: relative; top: -4px; line-height: 29px;}
|
||||
.laydate-time-list ol{height: 181px; overflow: hidden;}
|
||||
.laydate-time-list>li:hover ol{overflow-y: auto;}
|
||||
.laydate-time-list ol li{padding-left: 33px; line-height: 30px; text-align: left; cursor: pointer;}
|
||||
.laydate-time-list ol li{width: 130%; padding-left: 33px; line-height: 30px; text-align: left; cursor: pointer;}
|
||||
|
||||
/* 提示 */
|
||||
.layui-laydate-hint{position: absolute; top: 115px; left: 50%; width: 250px; margin-left: -125px; line-height: 20px; padding: 15px; text-align: center; font-size: 12px; color: #FF5722;}
|
||||
|
|
Loading…
Reference in New Issue