mirror of https://github.com/layui/layui
update
parent
37bc2311ca
commit
397cf80f7c
|
@ -258,12 +258,18 @@ layui.use('laydate', function(laydate){
|
|||
});
|
||||
|
||||
// 同时绑定多个
|
||||
laydate.render({
|
||||
elem: '.test-item',
|
||||
trigger: 'click'
|
||||
});
|
||||
/*
|
||||
lay('.test-item').each(function(){
|
||||
laydate.render({
|
||||
elem: this
|
||||
,trigger: 'click'
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
//自定义重要日
|
||||
var ins555 = laydate.render({
|
||||
|
|
|
@ -75,6 +75,17 @@
|
|||
that.index = ++laydate.index;
|
||||
that.config = lay.extend({}, that.config, laydate.config, options);
|
||||
|
||||
// 若 elem 非唯一,则拆分为多个实例
|
||||
var elem = lay(options.elem || that.config.elem);
|
||||
if(elem.length > 1){
|
||||
layui.each(elem, function(){
|
||||
laydate.render(lay.extend({}, that.config, {
|
||||
elem: this
|
||||
}));
|
||||
});
|
||||
return that;
|
||||
}
|
||||
|
||||
//初始化 id 参数
|
||||
options = that.config;
|
||||
options.id = ('id' in options) ? options.id : that.index;
|
||||
|
@ -1292,7 +1303,7 @@
|
|||
);
|
||||
};
|
||||
|
||||
//获得指定日期时间对象时间戳
|
||||
// 获得指定日期时间对象的毫秒数
|
||||
Class.prototype.getDateTime = function(obj){
|
||||
return this.newDate(obj).getTime();
|
||||
}
|
||||
|
@ -1773,8 +1784,9 @@
|
|||
|
||||
// 关闭日期面板
|
||||
laydate.close = function(id){
|
||||
var elem = lay('#'+ (id ? ('layui-laydate'+ id) : Class.thisElemDate));
|
||||
elem.remove();
|
||||
var that = thisModule.getThis(id || laydate.thisId);
|
||||
if(!that) return;
|
||||
return that.remove();
|
||||
};
|
||||
|
||||
//加载方式
|
||||
|
|
Loading…
Reference in New Issue