效果图:
JhYMDTimePicker.gif
使用方法 :
1. usingComponents 添加
"JhYMTimePicker": "../../JhTools/JhYMTimePicker/JhYMTimePicker"
2. wxml 添加组件
<JhYMDTimePicker isShowTimePicker='{{isShowTimePicker}}' selectTime="2020-02-02" bind:onConfirm="onConfirm">
</JhYMDTimePicker>
<JhYMDTimePicker isShowTimePicker='{{isShowTimePicker2}}' selectTime="2020-06" timeType="ym" bind:onConfirm="onConfirm">
</JhYMDTimePicker>
<JhYMDTimePicker isShowTimePicker='{{isShowTimePicker3}}' selectTime="2019-03-20 18:50" timeType="all" bind:onConfirm="onConfirm">
</JhYMDTimePicker>
<JhYMDTimePicker isShowTimePicker='{{isShowTimePicker4}}' selectTime="2020-08-02" minDate="{{minDate}}" bind:onConfirm="onConfirm">
</JhYMDTimePicker>
<JhYMDTimePicker isShowTimePicker='{{isShowTimePicker5}}' selectTime="2020-02-02" maxDate="{{maxDate}}" bind:onConfirm="onConfirm">
</JhYMDTimePicker>
3.点击事件
//点击选择器的 确定
onConfirm(event) {
let time = JhTime.Jh_timeStampToTime(event.detail, '{y}年{m}月{d}日 {h}:{i}:{s} 星期{w}');
console.log("点击确定 选择的时间 - " + time);
},
网友评论