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);
            });
        });

  

 

posted @ 2022-02-18 21:28  _York  阅读(334)  评论(0编辑  收藏  举报