- //选择年月日的 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: 'yyyy',
- 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" id="datetimepicker" type='text' class="form-control input-sm" readonly="readonly"/>
- <span class="input-group-addon input-sm">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>