<div class="form-group input-group date" data-provide="datepicker">
<label for="dp1" class="control-label">Pick a Date *</label>
<input id="dp1" type="text" class="form-control" ng-model="app1date" placeholder="DD-MM-YYYY" required="required" ">
<div class="input-group-addon">
<span ><i class="fa fa-calendar fa-lg" aria-hidden="true"></i></span>
</div>
<span class="material-input"></span>
</div>
<script>
$.fn.datepicker.defaults.format = "dd/mm/yyyy";
$.fn.datepicker.defaults.autoclose = true;
$.fn.datepicker.defaults.todayHighlight = true;
$.fn.datepicker.defaults.weekStart = 0;
$.fn.datepicker.defaults.starrtDate = "new Date"
$.fn.datepicker.defaults.todayBtn = "linked";
$.fn.datepicker.defaults.daysOfWeekHighlighted = "0,6";
$.fn.datepicker.defaults.todayHighlight = true;
$.fn.datepicker.defaults.assumeNearbyYear = true;
</script>
答案 0 :(得分:0)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
<script src="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<div id="datetimepicker1" class="input-group date">
<input type="text" class="form-control">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
</body>
</html>