-
Notifications
You must be signed in to change notification settings - Fork 7
/
example.html
102 lines (85 loc) · 3.28 KB
/
example.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html dir="ltr" lang="en-US" ng-app="MyApp">
<head>
<meta charset="UTF-8"/>
<title>A date range picker directive for angular and Twitter Bootstrap</title>
<link rel="stylesheet" type="text/css" media="all" href="bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" media="all" href="daterangepicker.css"/>
<script type="text/javascript" src="moment-2.8.1.js"></script>
<script type="text/javascript" src="angular-1.0.7.js"></script>
<script type="text/javascript" src="angular-daterange.js"></script>
<script type="text/javascript" src="example.js"></script>
</head>
<body>
<script type="text/ng-template" id="calendar.html">
<div class="calendar">
<table class="table-condensed">
<thead>
<tr>
<th class="prev available" ng-click="setPrevMonth()">
<i class="icon-arrow-left"></i>
</th>
<th colspan="5" style="width: auto">{{monthName}}</th>
<th class="next available" ng-click="setNextMonth()">
<i class="icon-arrow-right"></i>
</th>
</tr>
<tr>
<th ng-repeat="d in daysOfWeek">{{d}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="week in calendar">
<td class="available"
ng-click="pickDate(day)"
ng-repeat="day in week"
ng-class="{off: isOff(day), inrange:inRange(day), active: isActive(day)}">
{{getDayNumber(day)}}
</td>
</tr>
</tbody>
</table>
</div>
</script>
<script type="text/ng-template" id="daterange.html">
<div class="daterangepicker-container">
<div ng-transclude ng-click="toggle()" style="cursor:pointer"></div>
<div class="daterangepicker dropdown-menu opensright" ng-show="active">
<sl-calendar sdate="startDate" edate="endDate" right></sl-calendar>
<sl-calendar sdate="startDate" edate="endDate" left></sl-calendar>
<div class="confirm">
<button class="btn btn-success btn-small" ng-click="apply()">
Apply
</button>
<button class="btn btn-small" ng-click="cancel()">Cancel</button>
</div>
</div>
</div>
</script>
<div class="container" ng-controller="MainCtrl">
<div class="span12">
<h1>
<a href="https://github.com/SLonoed/angular-daterange" target="_blank">
angular-daterange directive
</a>
</h1>
</div>
<div class="span12">
<h4>Simple Example with link</h4>
<div class="well">
<div class="span4">
<sl-daterange start="range.start" finish="range.finish">
<a class="btn btn-link"> From {{getTimeStr(range.start)}} to {{getTimeStr(range.finish)}}</a>
</sl-daterange>
</div>
</div>
<h4>Simple Example with input</h4>
<div class="well">
<sl-daterange start="range.start" finish="range.finish">
<input type="text" ng-model="range.start"/>
</sl-daterange>
</div>
</div>
</div>
</body>
</html>