Merge pull request #39 from liubiao0810/master

修复选中今天期日choose方法得不到值
pull/61/head
贤心 2016-09-23 18:48:56 +08:00 committed by GitHub
commit 0da327c8a9
3 changed files with 22 additions and 15 deletions

View File

@ -760,7 +760,10 @@ Dates.events = function(){
as.otoday = S('#laydate_today');
Dates.on(as.otoday, 'click', function(){
var now = new Date();
Dates.creation([now.getFullYear(), now.getMonth() + 1, now.getDate()]);
// 2016-09-23 18:20:54 修复选中今天choose方法得不到数据
// Dates.creation([now.getFullYear(), now.getMonth() + 1, now.getDate()]);
Dates.elem[as.elemv] = laydate.now(0,Dates.options.format);
Dates.creation([Dates.ymd[0], Dates.ymd[1]+1, Dates.ymd[2]]);
});
//确认

File diff suppressed because one or more lines are too long

View File

@ -30,25 +30,29 @@
</div>
<script type="text/javascript" src="../laydate.dev.js"></script>
<script type="text/javascript" src="../laydate.js"></script>
<script type="text/javascript">
laydate({
elem: '#J-xl'
elem: '#J-xl',
format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
choose: function(datas){
console.log(datas);
}
});
document.getElementById('J-xl-2-btn').onclick = function(){
laydate({
elem: '#J-xl-2'
});
}
// document.getElementById('J-xl-2-btn').onclick = function(){
// laydate({
// elem: '#J-xl-2'
// });
// }
laydate({
elem: '#J-xl-3'
});
// laydate({
// elem: '#J-xl-3'
// });
laydate({
elem: document.getElementById('J-xl-4')
});
// laydate({
// elem: document.getElementById('J-xl-4')
// });
</script>
</body>
</html>