About the use of DateTimePicker, reference: http://www.jb51.net/article/99896.htm
To use an instance in Angularjs:
HTML code:
<div class= "Container" ng-app= "myApp" ng-controller= "Myctrl" > <div class= "Row" > <div class= ' col-sm-6 ' &
Gt <div class= "Form-group" > <label> Select Date:</label> <!--specify date tag--> <div class= ' Input-group da Te ' DateTimePicker id= ' datetimepicker1 ' > <input type= ' text ' class= ' Form-control ' ng-model= ' Dateone '/> Pan class= "Input-group-addon" > <span class= "Glyphicon Glyphicon-calendar" ></span> </span> ;/div> </div> <p> Results:{{dateone}}</p> </div> <div class= ' col-sm-6 ' > <div class = "Form-group" > <label> Select Date + Time:</label> <!--specify date tag--> <div class= ' input-group date ' id= ' da Tetimepicker2 ' > <input type= ' text ' class= ' Form-control "ng-model=" Datetwo "/> <span class=" input-group-a
Ddon "> <span class=" Glyphicon glyphicon-calendar "></span> </span> </div> </div> <p> results: {Datetwo}}</p> </div> </div> </div>
JS Code:
var app = Angular.module (' myApp ', []);
App.controller (' Myctrl ', function ($scope) {
///In Controller bind select control
var datepicker1 = $ (' #datetimepicker1 '). DateTimePicker ({
format: ' Yyyy-mm-dd ',
locale:moment.locale (' ZH-CN ')
}). On (' Dp.change ', function (e) {
var result = new Moment (e.date). Format (' Yyyy-mm-dd ');
$scope. Dateone = result;
$scope. $apply ();
});
$ (' #datetimepicker2 '). DateTimePicker ({
format: ' yyyy mm month dd Day hh:mm ',
locale:moment.locale (' ZH-CN ')
}). On (' Dp.change ', function (e) {
var result = new Moment (e.date). Format (' YYYY year mm month DD Day hh:mm ');
$scope. datetwo= result;
$scope. $apply ();
});
Effect Chart:
If you want to further study, you can click here to learn, and then attach 3 wonderful topics:
Bootstrap Learning Course
Bootstrap Practical Course
Bootstrap Table Use Tutorial
Bootstrap Plugin Usage Tutorial
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.