1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| function showdate(){ var dDate = new Date(); dDate.setFullYear(2017,8,22); var minDate = new Date(); minDate.setFullYear(1990,0,1); var maxDate = new Date(); maxDate.setFullYear(2050,11,31); plus.nativeUI.pickDate( function(e){ var d = e.date; mui.toast('你选择的时间是:' + d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate()); }, function(e){ mui.toast('没有选择'); }, { title : '请选择日期', date : dDate, minDate : minDate, maxDate : maxDate }); } function showtime(){ var myDate = new Date(); var hou = myDate.getHours(); var minu = myDate.getMinutes(); var dTime = new Date(); dTime.setHours(hou,minu); plus.nativeUI.pickTime( function(e){ var d = e.date; mui.toast('您选择的时间是:'+d.getHours()+':'+d.getMinutes()); }, function(e){ mui.toast('没有选择') }, { title : '请选择时间', is24Hour : 'true', time : dTime } ); }
|