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