詳解layui?laydate選擇時間的回調(diào)方法
控件初始打開的回調(diào)
控件在打開時觸發(fā),回調(diào)返回一個參數(shù):初始的日期時間對象
laydate.render({
elem: '#test'
,ready: function(date){
console.log(date); //得到初始的日期時間對象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
}
});日期時間被切換后的回調(diào)
年月日時間被切換時都會觸發(fā)?;卣{(diào)返回三個參數(shù),分別代表:生成的值、日期時間對象、結(jié)束的日期時間對象
laydate.render({
elem: '#test'
,change: function(value, date, endDate){
console.log(value); //得到日期生成的值,如:2017-08-18
console.log(date); //得到日期時間對象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
console.log(endDate); //得結(jié)束的日期時間對象,開啟范圍選擇(range: true)才會返回。對象成員同上。
}
});控件選擇完畢后的回調(diào)
點擊日期、清空、現(xiàn)在、確定均會觸發(fā)。回調(diào)返回三個參數(shù),分別代表:生成的值、日期時間對象、結(jié)束的日期時間對象
laydate.render({
elem: '#test'
,done: function(value, date, endDate){
console.log(value); //得到日期生成的值,如:2017-08-18
console.log(date); //得到日期時間對象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
console.log(endDate); //得結(jié)束的日期時間對象,開啟范圍選擇(range: true)才會返回。對象成員同上。
}
});到此這篇關于layui laydate選擇時間的回調(diào)方法的文章就介紹到這了,更多相關layui laydate回調(diào)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
關于window.pageYOffset和document.documentElement.scrollTop
window.pageYOffset:Netscape屬性,指的是滾動條頂部到網(wǎng)頁頂部的距離2011-04-04

