MUI DtPicker 显示自定义日期


MUI地址:http://dev.dcloud.net.cn/mui/ 首先引入相关JS CSS脚本。

HTML代码:

  <input   class="dt flat" style="width:200px;"     value='2018-05-16 19:00'     type="text">

 

 然后给class为dt增加JS事件

 <script>
       

        $(".dt").on('tap', function () {
            that = this;
            var _init = $(that).val();
            options = { "value": "" + _init + "", "customData": { "i": [{ "text": "00", "value": "00" }, { "text": "30", "value": "30" }] }, "labels": ["年", "月", "日", "时", "分"] };
            var dtPicker = new mui.DtPicker(options)
            dtPicker.show(function (rs) {
                $(that).val(rs.text);
            });
        });


    </script>

 效果


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM