bootstrap-datetimepicker详情的API:http://www.bootcss.com/p/bootstrap-datetimepicker/
Html代码:
<label class="col-xs-2 control-label"><i class="fa fa-clock-o"></i>开始时间:</label>
<div class="col-xs-3">
<input type="text" id="startTiem" name="startTiem" class="form-control form_datetime"
placeholder="开始时间" >
</div>
引入文件内容:
<asset:javascript src="bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"/>
<asset:javascript src="bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"/>
JS代码:
$(".form_datetime")
.datetimepicker({format: 'hh:mm', language: 'zh-CN', autoclose: true,startView:'day'})
.on('changeDate', function (ev) {
// var value = moment(ev.date.valueOf()).subtract(8, 'hour').format("YYYY-MM-DD dddd")
// $('#acceptTime').val(value)
});