让WeuiPicker隐藏日期中的日,只保留年月

weui.datePicker({
start: 1990,
end: new Date().getFullYear() + 3,
defaultValue: [year, month, 1],
onConfirm: function (result) {

var date = result[0] + "-";
if (result[1].toString().length == 1) {
date = date + "0";
}
date = date + result[1] + "-";
if (result[2].toString().length == 1) {
date = date + "0";
}
var show = date.substr(0, 7);
date = date + result[2];

//这里给input控件赋值

},

onChange: function (result) {
$('.weui-picker .weui-picker__bd .weui-picker__group').eq(2).hide();
}

$('.weui-picker .weui-picker__bd .weui-picker__group').eq(2).hide();

posted @ 2018-08-31 20:40  zhaogaojian  阅读(3860)  评论(0编辑  收藏  举报