The example in this article describes the method that the Bootstrap-datetimepicker implementation displays only to dates. Share to everyone for your reference, specific as follows:
Bootstrap-datetimepicker is usually set to the time and minutes, sometimes do not need, how to deal with it?
Minview: "Month",//select date, will not jump to select seconds
1. Introducing
<link href= "Public/css/bootstrap.min.css" type= "Text/css" rel= "stylesheet" >
<script type= "text/" JavaScript "src=" {sh::P ub}js/jquery-1.10.2.min.js "></script>
<link type=" Text/css "rel=" Stylesheet "href=" {sh::P ub}css/bootstrap-datetimepicker.min.css ">
<script src=" {sh::P ub}js/ Bootstrap-datetimepicker.min.js "type=" Text/javascript "/></script>
<script src=" {sh::P ub}js/ Bootstrap-datetimepicker.zh-cn.js "type=" Text/javascript "/></script>
2. Configure
Calendar
$ ('. Form_datetime '). DateTimePicker ({
minview: "Month",///Select date, will not jump to choose time seconds
language: ' ZH-CN ',
format: ' Yyyy-mm-dd ',
todaybtn:1,
autoclose:1,
});
3.html
<div class= "Form-group row" >
<div class= "left col-xs-3 text-right" >
<label for= "" >* Time: </label>
</div>
<div class= "right col-xs-6 text-left" >
<div class= "Input-group ">
<input type=" text "class=" Form-control form_datetime "id=" Addtime "name=" Addtime "value=" {sh:$ info.addtime|default= $time |date= ' y-m-d ', ###} "placeholder=" ">
<span class=" Input-group-addon "id=" Basic-addon2 "><span class= glyphicon glyphicon-time" aria-hidden= "true" ></span></span>
</div>
</div>
</div>
More readers interested in JavaScript-related content can view the site topics: "JavaScript time and date Operation skills Summary", "JavaScript data structure and algorithm skills summary", "JavaScript switching effects and techniques summary", " JavaScript Search Algorithm Tips summary, JavaScript animation effects and techniques summary, JavaScript error and debugging skills Summary, JavaScript traversal algorithm and techniques summary and JavaScript mathematical Operational Usage Summary
I hope this article will help you with JavaScript programming.