• mui日期设置与时钟样式时间设置


    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title></title>
        <script src="js/mui.min.js"></script>
        <link href="css/mui.min.css" rel="stylesheet"/>
        <script type="text/javascript" charset="utf-8">
              mui.init();
        </script>
    </head>
    <body>
        <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
            <h1 class="mui-title">时钟效果</h1>
        </header>
        <div class="mui-content">
            <div style="padding: 20px;">
                <button type="button" onclick="showDate();">获取日期</button>
                <button type="button" onclick="showTime();">获取时间 </button>
            </div>
        </div>
    </body>
    <script type="text/javascript">
        function showDate(){
            var dDate = new Date();
            dDate.setFullYear(2018,3,8);
            var minDate = new Date();
            minDate.setFullYear(2010,1,1);
            var maxDate = new Date();
            maxDate.setFullYear(2020,12,31);
            
            plus.nativeUI.pickDate(
                function(e){
                    var d = e.date;
                    mui.toast('您选择的日期是:'+d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate());
                },
                function(e){
                    mui.toast('您没有选择');
                },
                {
                    title:'请选择日期',
                    date:dDate,
                    minDate:minDate,
                    maxDate:maxDate
                }
            );
        }
        function showTime(){
            var myDate = new Date();
            var h = myDate.getHours();
            var min = myDate.getMinutes();
            var dTime = new Date();
            dTime.setHours(h,min);
            
            plus.nativeUI.pickTime(function(e){
                var d = e.date;
                mui.toast("您选择的时间是:"+d.getHours()+":"+d.getMinutes());
            },function(e){
                mui.toast("您没有选择时间");
            },{
                title:"请选择时间",
                is24Hour:true,
                time:dTime
            });
        }
    </script>
    </html>
    

      

  • 相关阅读:
    2015 Multi-University Training Contest 2 1004 Delicious Apples(DP)
    开门人和关门人
    数据降维 实例
    Leetcode题解(5):L58/Length of Last Word
    JavaWeb开发环境搭建
    Linux配置hugepage
    lua的函数初识
    有人离职时经理的反应是?
    svn如何回滚到之前版本
    python用httplib模块发送get和post请求
  • 原文地址:https://www.cnblogs.com/smxbo/p/12526980.html
Copyright © 2020-2023  润新知