-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
65 lines (62 loc) · 2.11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Date Select Demo</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<style>
.sb-date-select-select {
display: inline-block;
width: 100px;
margin-right: 5px;
}
</style>
</head>
<body ng-app="app">
<div class="container" ng-controller="Controller">
<h1>Date Select Example</h1>
<div class="row">
<form class="col-md-6" novalidate name="form">
<div class="form-group">
<label>Date 1</label>
<div sb-date-select sb-select-class="form-control" ng-model="obj.date1"></div>
</div>
<div class="form-group">
<label>Date 2</label>
<div sb-date-select sb-select-class="form-control" min="{{date2Min}}" max="2008-11-24" ng-model="obj.date2"></div>
<div class="help-block">Must be between {{date2Min|formatDate:'ll'}} and November 24, 2008</div>
<a ng-click="date2Min='2005-12-25'">Set min to xmas '05</a>
</div>
</form>
<div class="col-md-6">
<h3>Scope</h3>
<pre>
Date 1: {{obj.date1}}
Date 2: {{obj.date2}}
</pre>
</div>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.js"></script>
<script>window.moment || document.write('<script src="bower_components/moment/moment.js"><\/script>')</script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script>window.angular || document.write('<script src="bower_components/angular/angular.js"><\/script>')</script>
<script src="src/sb-date-select.js"></script>
<script>
angular.module('app', ['sbDateSelect'])
.filter('formatDate', function() {
return function(date, format) {
if (!date) return;
else return moment(date).format(format);
};
})
.controller('Controller', function ($scope) {
$scope.obj = {
date1: '1993-07-03',
date2: null,
};
$scope.date2Min = '2001-05-10';
});
</script>
</body>
</html>