forked from dangrossman/daterangepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.html
More file actions
159 lines (134 loc) · 6.23 KB
/
examples.html
File metadata and controls
159 lines (134 loc) · 6.23 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="UTF-8" />
<title>A date range picker for Twitter Bootstrap</title>
<link rel="stylesheet" type="text/css" media="all" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" media="all" href="daterangepicker.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="daterangepicker.js"></script>
</head>
<body>
<div class="container">
<div class="span12">
<h4>Simple Example</h4>
<div class="well">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="reservation">Reservation dates:</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-calendar"></i></span><input type="text" name="reservation" id="reservation" value="03/18/2013 - 03/23/2013" />
</div>
</div>
</div>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#reservation').daterangepicker();
});
</script>
</div>
<h4>Options Usage Example</h4>
<div class="well">
<div id="reportrange" class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
<i class="icon-calendar icon-large"></i>
<span></span> <b class="caret" style="margin-top: 8px"></b>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#reportrange').daterangepicker(
{
ranges: {
'Today': [new Date(), new Date()],
'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
'Last 7 Days': [moment().subtract('days', 6), new Date()],
'Last 30 Days': [moment().subtract('days', 29), new Date()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
},
opens: 'left',
format: 'MM/DD/YYYY',
separator: ' to ',
startDate: moment().subtract('days', 29),
endDate: new Date(),
minDate: '01/01/2012',
maxDate: '12/31/2013',
locale: {
applyLabel: 'Submit',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom Range',
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
},
showWeekNumbers: true,
buttonClasses: ['btn-danger'],
dateLimit: false
},
function(start, end) {
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
}
);
//Set the initial state of the picker label
$('#reportrange span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
});
</script>
</div>
<h4>Month/Year Dropdowns</h4>
<div class="well">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="reservation">Date range:</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-calendar"></i></span><input type="text" name="reservation" id="daterange" />
</div>
</div>
</div>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#daterange').daterangepicker(
{
minDate: '01/01/2010',
maxDate: '12/31/2015',
showDropdowns: true
}
);
});
</script>
</div>
<h4>Range Limit Example</h4>
<div class="well">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="reservation">Reservation dates:</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-calendar"></i></span><input type="text" name="reservation" id="limited" value="03/18/2013 - 03/21/2013" />
</div>
</div>
</div>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#limited').daterangepicker(
{
dateLimit: { days: 3 }
});
});
</script>
</div>
</div>
</div>
</body>
</html>