• 时间控件,页面刷新初始化时间控件只显示年月


    <!DOCTYPE HTML>
    <html>
    <head>
    <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" media="screen"
    href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css">
    </head>
    <body>
    <div id="datetimepicker" class="input-append date">
    <input type="text"class="inputText"></input>
    <span class="add-on">
    <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
    </span>
    </div>
    <script type="text/javascript"
    src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js">
    </script>
    <script type="text/javascript"
    src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js">
    </script>
    <script type="text/javascript"
    src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js">
    </script>
    <script type="text/javascript">
    $('#datetimepicker').datetimepicker({
    format: 'yyyy-MM',
    language: 'en',
    pickDate: true,
    //pickTime: true,
    hourStep: 1,
    minuteStep: 15,
    secondStep: 30,
    inputMask: true
    });
    var date=new Date();
    var year=date.getFullYear();
    var month=date.getMonth()+1;
    $(".inputText").val(year+'-'+month)
    </script>
    </body>
    <html>

  • 相关阅读:
    React全家桶+AntD 共享单车后台管理系统开发
    eclipse中通过Properties Editor插件查看配置文件中Unicode内容
    修改eclipse的编码格式
    后端接收前端数据中文乱码解决方案
    MySQL基础
    wordpress个人常用标签调用
    4gl游标cursor
    尝试写一写4gl与4fd
    foreach循環體控制
    保护wordpress后台登录地址
  • 原文地址:https://www.cnblogs.com/workstation-nigoudongma/p/9957465.html
Copyright © 2020-2023  润新知