pull/80/merge
庞军鹏 2018-12-20 08:03:51 +00:00 committed by GitHub
commit 5dfd461431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

2
dist/laydate.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1466,7 +1466,8 @@
lay.each([start, end], function(i, item){
if(!('month' in item)) return;
lay.extend(item, {
month: item.month + 1
month: item.month + 1,
value: that.formatDate(item)
});
});
@ -1475,7 +1476,15 @@
return that;
};
// 格式化为时间对象
Class.prototype.formatDate = function(timeObj){
var date = new Date()
for(var i in timeObj){
var setValue = i.replace(/^[a-z]/, function(h){ return h.toUpperCase() })
date['set' + setValue](timeObj[i])
}
return date
}
//选择日期
Class.prototype.choose = function(td){
var that = this
@ -1631,7 +1640,7 @@
} else {
if(lay(btn).hasClass(DISABLED)) return that.hint('不在有效日期或时间范围内');
}
that.done();
that.done(null, 'confirm');
that.setValue(that.parse()).remove()
}
};