zoukankan      html  css  js  c++  java
  • bootstrap日期时间插件datetimepicker

    <!DOCTYPE HTML>
    02 <html>
    03   <head>
    04     <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
    05     <link rel="stylesheet" type="text/css" media="screen"
    06      href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css">
    07   </head>
    08   <body>
    09     <div id="datetimepicker" class="input-append date">
    10       <input type="text"></input>
    11       <span class="add-on">
    12         <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
    13       </span>
    14     </div>
    15     <script type="text/javascript"
    16      src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js">
    17     </script>
    18     <script type="text/javascript"
    19      src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js">
    20     </script>
    21     <script type="text/javascript"
    22      src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js">
    23     </script>
    24     <script type="text/javascript">
    25       $('#datetimepicker').datetimepicker({
    26         format: 'MM/dd/yyyy hh:mm',
    27         language: 'en',
    28         pickDate: true,
    29         pickTime: true,
    30         hourStep: 1,
    31         minuteStep: 15,
    32         secondStep: 30,
    33         inputMask: true
    34       });
    35     </script>
    36   </body>
    37

    <html>

    格式如下:

    <input id="to_datetime" type="text" class="zc_input" value="结束日期" data-date-format="yyyy-mm-dd hh:ii" data-date="<?php echo date('Y-m-d',time())?>T05:25:07Z">

    <script>

      $('#from_datetime').datetimepicker({
            language:  'zh-CN',
            format: 'yyyy-mm-dd hh:ii',
            weekStart: 1,
            todayBtn:  1,
      autoclose: 1,
      todayHighlight: 1,
      startView: 2,
      forceParse: 0,
            showMeridian: 1,
      initialDate:2013-12-23
            //pickerPosition: "bottom-left"
        });

    </script>

                  by:yttsic

  • 相关阅读:
    vm中花屏的最直接解决办法
    【转】SQL SERVER中一些常见性能问题的总结
    好不容易把Head First Design Patterns下下来了,与大家分享一下
    没想到单位的bt下载的速度可以到这么快,满意了
    买了张水货的1Gsd卡
    商业缩略语汇总
    一些个人收集的书籍恢复下载
    sourceforge.net 是不是被封了?
    2009年我大学毕业了,我工作了,总结成长中的我的2009年 Fred
    Web Service的传输协议
  • 原文地址:https://www.cnblogs.com/yttsic/p/3492401.html
Copyright © 2011-2022 走看看