1, the introduction of time plug-ins required js and CSS
<script type= "Text/javascript" src= "<%=path%>/static/js/bootstrap-datetimepicker.min.js" charset= "UTF-8" ></script><script type= "Text/javascript" src= "<%=path%>/static/js/ Bootstrap-datetimepicker.zh-cn.js "charset=" UTF-8 "></script>
1 |
<link href= "<%=path %>/static/css/bootstrap-datetimepicker.min.css" rel= "stylesheet" media= "screen" > |
For date plug-ins we generally use two dates, one is date, the other is time
2.1 How dates are used
<div class= "Form-group" > <label class= "col-sm-2 control-label" > User expiry: <font size= "2" colo R= "Red" >*</font></label> <div class= "col-sm-4" > <div class= "Input-gro Up date form_date col-md-5 "style=" padding-left:0px;padding-right:0px; " > <input class= "Form-control" type= "text" id= "SuExpire1" name= "SuExpire1"/> <span class= "Input-group-addon" ><span class= "Glyphicon Glyphicon-calendar" ></span></span> </div> <label class= "error" for= "SuExpire1" ></label> </div> <label class= "col-sm-2 control-label" > Password expiry: <font size= "2" color= "Red" >*</font></label& Gt <div class= "col-sm-4" > <div class= "input-group date form_date col-md-5" style= "padding-left:0px;p adding-right:0px; " > <input class="Form-control" type= "text" id= "SupwExpire1" name= "SupwExpire1"/> <span class= "Input-group-addon "><span class=" Glyphicon Glyphicon-calendar "></span></span> </div> <label class= "error" for= "SupwExpire1" ></label> </div> </div>
Year-month-day $ (function () { $ (". Form_date"). DateTimePicker ({ language: ' ZH-CN ', format: ' Yyyy-mm-dd ', weekstart:1, todaybtn: 1, autoclose:1, todayhighlight:1, startview:2, minview:2, forceparse:0 });
2.2 How the time is used
<label> Release Date: </label><font size= "1" color= "Red" >*</font><div class= "Input-group date form _datetime col-md-5 " style=" padding-left:0px;padding-right:0px; > <input class= "Form-control input-sm" type= "text" id= "publishDate1" name= "publishDate1" Readonly> < Span class= "Input-group-addon" ><span class= "Glyphicon glyphicon-th" ></span></span></div >
Year-month-day time: minute: seconds $ (function () { $ ('. Form_datetime '). DateTimePicker ({ language: ' ZH-CN ', format: ' Yyyy-mm-dd hh:ii:ss ', weekstart:1, todaybtn: 1, autoclose:1, todayhighlight:1, Startview:2, forceparse:0, showmeridian:1 });
Use of Bootstrap-datetimepicker time plug-ins in Java