mirror of https://github.com/layui/laydate
5.0.1
parent
51ce00a7d4
commit
8245d17a4d
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -1,18 +1,3 @@
|
|||
|
||||
# v5.0.0
|
||||
|
||||
* 全新重写
|
||||
* 支持单独显示年选择器、年月选择器、日期选择器、时间选择器、日期时间选择器
|
||||
* 支持双控件,用于选择年/年月/日期/时间/日期时间五种类型选择器的范围(可顺时、逆时)
|
||||
* 支持日期格式的自定义
|
||||
* 支持日期是否合法的自动校验
|
||||
* 支持有效日期范围的设定
|
||||
* 支持内置事件(可自定义)、外部事件、直接显示等多种调用方式
|
||||
* 支持中文版和国际版的语言设定
|
||||
* 支持开启公历节日和标记重要日期
|
||||
* 支持直接嵌套在页面的某个容器中
|
||||
* 支持底部按钮的任意顺序排版
|
||||
* 支持智能显示在最佳可视坐标
|
||||
* 支持回车快捷键选择
|
||||
* 支持多种内置主题的设定,支持自定义主题色,且可单独定制主题
|
||||
# [更新日志](http://www.layui.com/laydate/changelog.html)
|
||||
|
||||
|
|
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": "layui-laydate",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"alias": "laydate",
|
||||
"description": "日期与时间组件",
|
||||
"main": "src/laydate.js",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
|
||||
@Name : layDate 5.0 日期时间控件
|
||||
@Name : layDate 5.0.1 日期时间控件
|
||||
@Author: 贤心
|
||||
@Site:http://www.layui.com/laydate/
|
||||
@License:MIT
|
||||
|
@ -55,7 +55,7 @@
|
|||
}
|
||||
|
||||
,laydate = {
|
||||
v: '5.0'
|
||||
v: '5.0.1'
|
||||
,config: {} //全局配置项
|
||||
,index: (window.laydate && window.laydate.v) ? 100000 : 0
|
||||
,path: ready.getPath
|
||||
|
@ -705,7 +705,9 @@
|
|||
|
||||
Class.thisElem = that.elemID;
|
||||
|
||||
typeof options.ready === 'function' && options.ready(options.dateTime);
|
||||
typeof options.ready === 'function' && options.ready(lay.extend({}, options.dateTime, {
|
||||
month: options.dateTime.month + 1
|
||||
}));
|
||||
};
|
||||
|
||||
//控件移除
|
||||
|
@ -866,6 +868,8 @@
|
|||
checkValid(dateTime)
|
||||
};
|
||||
|
||||
if(fn === 'limit') return checkValid(dateTime), that;
|
||||
|
||||
value = value || options.value;
|
||||
if(typeof value === 'string'){
|
||||
value = value.replace(/\s+/g, ' ').replace(/^\s|\s$/g, '');
|
||||
|
@ -1212,7 +1216,7 @@
|
|||
that.list('month', index);
|
||||
}
|
||||
} else {
|
||||
that.calendar();
|
||||
that.checkDate('limit').calendar();
|
||||
that.closeList();
|
||||
}
|
||||
|
||||
|
@ -1516,12 +1520,15 @@
|
|||
that.startState = true;
|
||||
}
|
||||
lay(that.footer).find(ELEM_CONFIRM)[that.endDate ? 'removeClass' : 'addClass'](DISABLED);
|
||||
} else if(!(options.type === 'datatime' || options.position === 'static')){
|
||||
setDateTime(true);
|
||||
that.setValue(that.parse()).remove().done();
|
||||
} else {
|
||||
} else if(options.position === 'static'){ //直接嵌套的选中
|
||||
setDateTime(true);
|
||||
that.calendar().done().done(null, 'change');
|
||||
} else if(options.type === 'date'){
|
||||
setDateTime(true);
|
||||
that.setValue(that.parse()).remove().done();
|
||||
} else if(options.type === 'datetime'){
|
||||
setDateTime(true);
|
||||
that.calendar().done(null, 'change');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1634,7 +1641,7 @@
|
|||
prevYear: function(){
|
||||
if(addSubYeay('sub')) return;
|
||||
dateTime.year--;
|
||||
that.calendar();
|
||||
that.checkDate('limit').calendar();
|
||||
options.range || that.done(null, 'change');
|
||||
}
|
||||
,prevMonth: function(){
|
||||
|
@ -1643,7 +1650,7 @@
|
|||
year: YM[0]
|
||||
,month: YM[1]
|
||||
});
|
||||
that.calendar();
|
||||
that.checkDate('limit').calendar();
|
||||
options.range || that.done(null, 'change');
|
||||
}
|
||||
,nextMonth: function(){
|
||||
|
@ -1652,13 +1659,13 @@
|
|||
year: YM[0]
|
||||
,month: YM[1]
|
||||
});
|
||||
that.calendar();
|
||||
that.checkDate('limit').calendar();
|
||||
options.range || that.done(null, 'change');
|
||||
}
|
||||
,nextYear: function(){
|
||||
if(addSubYeay()) return;
|
||||
dateTime.year++
|
||||
that.calendar();
|
||||
that.checkDate('limit').calendar();
|
||||
options.range || that.done(null, 'change');
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue