本文转载自:http://blog.csdn.net/feng1603/article/details/41869523

直接上代码:

//选择年月日的       startView: 2,   minView: 2, format: 'yyyymmdd',
$('#datetimepicker').datetimepicker({
        format: 'yyyymmdd',
         weekStart: 1,
         autoclose: true,
         startView: 2,
         minView: 2,
         forceParse: false,
         language: 'zh-CN'
    });
//选择年月的       startView: 3,   minView: 3, format: 'yyyymm',
$('#datetimepicker').datetimepicker({
        format: 'yyyymm',
         weekStart: 1,
         autoclose: true,
         startView: 3,
         minView: 3,
         forceParse: false,
         language: 'zh-CN'
    });
//选择年的       startView: 4,   minView: 4, format: 'yyyy',
$('#datetimepicker').datetimepicker({
        format: 'yyyymm',
         weekStart: 1,
         autoclose: true,
         startView: 4,
         minView: 4,
         forceParse: false,
         language: 'zh-CN'
    });
    <div class="col-md-7">
                 <div class='input-group date form_date' >
                    <input name="startTm" />
                    <span class="input-group-addon input-sm">
                      <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div> 
   </div>

在这里遇到很多问题:什么日历图标没反映啊,输入框和日历图标对不齐啊,点日历图标把数据清了啊……都是样式问题,所以提供几种样式,一种一种试吧……博大精深啊……

 

<div class='input-group date form_date' data-date-format="yyyymmdd">
    <input name="startTm" ></span>
    </span>
</div> 

 

            <div class="date input-append"  ></i></span></div>
                  </div> 

相关文章:

  • 2021-08-13
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
猜你喜欢
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案