MUI 时间选择设置为只选择年
<style> [data-type="month"] .mui-picker, [data-type="month"] .mui-dtpicker-title h5 { width: 100%; } [data-id="picker-m"], [data-id="title-m"] { display: none!important; } /*[data-type="month"] { display: none; }*/ </style>
$("#btnYearMonth").on("tap", function () { var dtpicker = new mui.DtPicker({ "type": "month", "customData": { "h": [ { value: "am", text: "上午" }, { value: "pm", text: "下午" }, ] } }); dtpicker.show(function (e) { $("#YearMonth").val(e.y.text); }); });