这是一个工作示例 - 你需要从https://github.com/fragaria/angular-daterangepicker下载并包含“angular-daterangepicker.min.js”这个文件
<head>
<meta charset="utf-8">
<title>Daterange picker example</title>
<!-- bower:css -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-daterangepicker/2.1.13/daterangepicker.min.css" />
<!-- endbower -->
</head>
<body>
<!-- bower:js -->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.20/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular-messages.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-daterangepicker/2.1.13/daterangepicker.min.js"></script>
<!-- endbower -->
<script src="angular-daterangepicker-master/js/angular-daterangepicker.min.js"></script>
<div class="container">
<h1>Daterange picker example</h1>
<div class="row">
<div class="col-md-6" ng-controller="TestCtrl">
<form name="dateForm" class="form-horizontal">
<div class="form-group">
<label for="daterange1" class="control-label">Simple picker</label>
<input date-range-picker id="daterange1" name="daterange1" class="form-control date-picker" type="text"
ng-model="date" required/>
</div>
</form>
<div class="row">
<h4>Model:</h4>
<div class="col-md-12 well">
<label>Date range:</label><br>
{{date | json}}<br>
<label>Single date:</label><br>
{{singleDate | json}}<br>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
exampleApp = angular.module('example', ['ngMessages', 'daterangepicker']);
exampleApp.controller('TestCtrl', function($scope) {
$scope.date = {
startDate: null,
endDate: null
};
});
angular.bootstrap(document, ['example']);</script>
</html>