微信小程序提供时间选择器的接口,开发者可以根据自己的需求进行自定义设置
下面是小程序提供的示例:
其中 fields属性用于控制选择器选级别,分别有:<view class="section"> <view class="section__title">日期选择器</view> <picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange"> <view class="picker"> 当前选择: {{date}} </view> </picker> </view>
year: 选择器只能选择某年
month: 选择器选择年月
day:选择器选择年月日
微信小程序api
https://mp.weixin.qq.com/debug/wxadoc/dev/component/picker.html