HTML
-
记得引入 picker.css 和 picker.js picker.js 要放到mui.js 的后面
JS
//开始时间document.getElementById('starttime').addEventListener('tap', function(){ option={"type":"date","beginYear":"1980","endYear":"2030"}; var picker = new mui.DtPicker(option); picker.show(function(rs) { console.log(rs.text) document.getElementById('starttime').innerHTML = rs.text; }); },false);//结束时间document.getElementById('endtime').addEventListener('tap', function(){ option={"type":"date","beginYear":"1980","endYear":"2030"}; var picker = new mui.DtPicker(option); picker.show(function(rs) { console.log(rs.text) document.getElementById('endtime').innerHTML = rs.text; }); },false);