forked from najlepsiwebdesigner/foundation-datetimepicker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.html
More file actions
221 lines (210 loc) · 8.59 KB
/
example.html
File metadata and controls
221 lines (210 loc) · 8.59 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Foundation DateTimePicker</title>
<meta name="description" content="Port of bootstrap datepicker to Zurb Foundation framework">
<meta name="author" content="Peter Beno, najlepsiwebdesigner@gmail.com">
<!-- CDN -->
<script src="http://code.jquery.com/jquery.min.js"></script>
<!-- foundation start -->
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Included CSS Files (Compressed) -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.0.2/css/foundation.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/foundation/5.0.2/js/modernizr.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css">
<!-- foundation end -->
<!-- foundation datepicker start -->
<script src="foundation-datetimepicker.js"></script>
<link rel="stylesheet" href="foundation-datepicker.css">
<!-- foundation datepicker end -->
<link rel="stylesheet" href="example.css">
</head>
<body>
<header class="row">
<h1 class="large-12 columns subheader">DateTimePicker for Foundation <br><small>foundation-datetimepicker.js</small></h1>
</header>
<div class="row">
<div class="large-12 columns alert-box alert">
This project is in early prototype stage, this documentation page belongs to foundation-datepicker and has to be rewritten.
</div>
</div>
<div class="row">
<div class="large-3 columns" id="sidebar-wrap">
<h3>About</h3>
<p>Foundation jQuery datepicker plugin!</p>
<ul>
<li><a href="http://foundation-datepicker.peterbeno.com/">project website</a></li>
<li><a href="https://github.com/najlepsiwebdesigner/foundation-datepicker">forked project @github</a></li>
</ul>
<p>
Based on best available datepicker in this galaxy - bootstrap-datepicker:
<ul>
<li><a href="http://www.eyecon.ro/bootstrap-datepicker/">website</a></li>
<li><a href="https://github.com/eternicode/bootstrap-datepicker">github</a></li>
</ul>
</p>
<h4>Description:</h4>
<ul>
<li>can be used as a component</li>
<li>formats: dd, d, mm, m, yyyy, yy</li>
<li>separators: -, /, .</li>
</ul>
<div class="alert-box">
<h6>Warning!</h6> <br> This plugin is really fresh and even when it uses really robust, tested base (bootstrap-datepicker plugin), this is only early prototype, which was not properly tested - so please, if you find an error, report it to github. Thanks! :)
</div>
</div>
<div class="large-9 columns">
<h2>Example</h2>
<p>Attached to a field with the format specified via options.</p>
<div class="panel">
<input type="text" value="02-16-2012 23:00" id="dp1" >
</div>
<p>Attached to a field with the format specified via data tag and close button enabled.</p>
<div class="panel">
<input type="text" value="02/16/12 10:22" data-date-format="mm/dd/yy hh:ii" id="dp2" >
</div>
<p>As component.</p>
<div class="panel">
<div class="row date collapse" id="dp3" data-date="12-02-2012 10:22" data-date-format="dd-mm-yyyy hh:ii">
<input class="large-3 columns" size="16" type="text" value="12-02-2012 10:22" readonly>
<span class="prefix large-1 columns end"><i class="icon-calendar"></i></span>
</div>
</div>
<p>Start with years viewMode.</p>
<div class="panel">
<div class="row date collapse" id="dpYears" data-date="12-02-2012 9:20:22" data-date-format="dd-mm-yyyy hh:ii:ss" data-date-viewmode="year">
<input class="columns three" size="16" type="text" value="12-02-2012 9:20:22" readonly>
<span class="prefix columns one end"><i class="icon-calendar"></i></span>
</div>
</div>
<hr>
<h2>Using foundation-datepicker.js</h2>
<p>Call the datepicker via javascript:</p>
<pre class="prettyprint linenums">$('.datepicker').fdatepicker()</pre>
<h3>Options</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width: 100px;">Name</th>
<th style="width: 100px;">data Tag</th>
<th style="width: 50px;">type</th>
<th style="width: 100px;">default</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>format</td>
<td>data-date-format</td>
<td>string</td>
<td>'mm/dd/yyyy'</td>
<td>the date format, combination of d, dd, m, mm, yy, yyy.</td>
</tr>
<tr>
<td>weekStart</td>
<td>data-date-weekstart</td>
<td>integer</td>
<td>0</td>
<td>day of the week start. 0 for Sunday - 6 for Saturday</td>
</tr>
<tr>
<td>viewMode</td>
<td>data-date-view-mode</td>
<td>string|integer</td>
<td>0 = 'days'</td>
<td>set the start view mode. Accepts: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years</td>
</tr>
<tr>
<td>minViewMode</td>
<td>data-date-min-view-mode</td>
<td>string|integer</td>
<td>0 = 'days'</td>
<td>set a limit for view mode. Accepts: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years</td>
</tr>
<tr>
<td>startDate</td>
<td>data-date-startdate</td>
<td>string|date</td>
<td>-</td>
<td>set a starting date limit for the calendar. Accepts date format as "2013-01-01".</td>
</tr>
<tr>
<td>pickTime</td>
<td>data-date-pick-time</td>
<td>boolean</td>
<td>1</td>
<td>Set 0 to stop time picking.</td>
</tr>
</tbody>
</table>
<h3>Markup</h3>
<p>Format a component.</p>
<pre class="prettyprint linenums">
<div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
<input size="16" type="text" value="12-02-2012">
<span class="add-on"><i class="icon-th"></i></span>
</div>
</pre>
<h3>Methods</h3>
<h4>.fdatepicker(options)</h4>
<p>Initializes an datepicker.</p>
<h4>.fdatepicker('show')</h4>
<p>Show the datepicker.</p>
<h4>.fdatepicker('hide')</h4>
<p>Hide the datepicker.</p>
<h4>.fdatepicker('place')</h4>
<p>Updates the date picker's position relative to the element</p>
<h4>.fdatepicker('setValue', value)</h4>
<p>Set a new value for the datepicker. It cand be a string in the specified format or a Date object.</p>
<h3>Events</h3>
<p>Datepicker class exposes a few events for manipulating the dates.</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width: 150px;">Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>show</td>
<td>This event fires immediately when the date picker is displayed.</td>
</tr>
<tr>
<td>hide</td>
<td>This event is fired immediately when the date picker is hidden.</td>
</tr>
<tr>
<td>changeDate</td>
<td>This event is fired when the date is changed.</td>
</tr>
</tbody>
</table>
<pre class="prettyprint linenums">
$('#dp5').fdatepicker()
.on('changeDate', function(ev){
if (ev.date.valueOf() < startDate.valueOf()){
....
}
});
</pre>
</div>
</div>
</section>
<script>
$(function(){
window.prettyPrint && prettyPrint();
$('#dp1').fdatetimepicker({
format: 'mm-dd-yyyy hh:ii'
});
$('#dp2').fdatetimepicker({closeButton:true});
$('#dp3').fdatetimepicker();
$('#dp3').fdatetimepicker();
$('#dpYears').fdatetimepicker();
$('#dpMonths').fdatetimepicker();
});
</script>
</body>
</html>