forked from jdewit/ez-datetime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
125 lines (92 loc) · 4.54 KB
/
demo.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Ez-Date-Picker</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.css" rel="stylesheet"/>
<link href="https://rawgit.com/jdewit/ez-dropdown/master/dist/ez-dropdown.min.css" rel="stylesheet"/>
<link href="demo/style.css" rel="stylesheet"/>
<link href="dist/ez-datetime.css" rel="stylesheet"/>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
<script src="https://rawgit.com/jdewit/ez-transition/master/dist/ez-transition.min.js"></script>
<script src="https://rawgit.com/jdewit/ez-modal/master/dist/ez-modal.min.js"></script>
<script src="https://rawgit.com/jdewit/ez-modal/master/dist/ez-modal-tpl.min.js"></script>
<script src="https://rawgit.com/jdewit/ez-dropdown/master/dist/ez-dropdown.min.js"></script>
<script src="dist/ez-datetime.js"></script>
<script src="dist/ez-datetime-tpl.js"></script>
<script src="demo/script.js"></script>
</head>
<body ng-app="myApp" class="container">
<h2><a href="#">ez-datetime</a></h2>
<hr>
<div ng-controller="myCtrl" class="col-lg-8 col-md-8">
<h3>Button Control</h3>
<a class="btn btn-default" ez-datetime-control ng-model="form.date1" config="config1" model-format="x" ng-change="modelChanged()">
<i class="glyphicon glyphicon-calendar"></i>
{{ form.date1 ? (form.date1 | ezDate:'MMMM Do, YYYY [at] h:mma') : 'Pick a Date' }}
</a>
<a ng-if="!!form.date1" ng-click="form.date1 = null">- clear</a>
<br>
Model value => {{ form.date1 || 'null' }}
<hr>
<h3>Input Control - limit range <small>({{ form.date3Min | ezDate:'lll' }} - {{ form.date3Max | ezDate:'lll' }})</small></h3>
<form name="_form">
<div class="input-group">
<input class="form-control" ez-datetime-control type="text" ng-model="form.date3" min-date="form.date3Min" max-date="form.date3Max" view-format="YYYY-MM-DD h:mma" ng-change="log('date3 changed')"/>
<div class="input-group-addon">
<a ez-datetime-control ng-model="form.date3" min-date="form.date3Min" max-date="form.date3Max" view-format="YYYY-MM-DD h:mma" ng-change="log('date3 changed')"/>
<i class="glyphicon glyphicon-calendar"></i>
</a>
</div>
</div>
</form>
<hr>
<h3>Range Selector</h3>
<form name="_form4">
<a ez-datetime-range-control from="form.date4From" to="form.date4To" on-change="modelChanged()">
{{ (form.date4From | ezDate:'MMM Do, YYYY [at] h:mma')|| 'Start Date' }} - {{ (form.date4To | ezDate:'MMM Do, YYYY [at] h:mma') || 'End Date' }}
</a>
</form>
Form Dirty State => {{ _form4.$dirty }}
<br>
{
from: {{ form.date4From || 'null' }},<br>
to: {{ form.date4To || 'null' }}
}
<hr>
<h3>Input Range Selector</h3>
<form name="_form5">
<input class="form-control" type="text" ez-datetime-range-control from="date5Range.from" to="date5Range.to" shortcut="form.date5Shortcut" on-change="log('date5Range changed')" range-enabled="true"/>
</form>
Form Dirty State => {{ _form5.$dirty }}
<br>
Model value => {{ form.date5Range || 'null' }}
<br>
Shortcut => {{ form.date5Shortcut }}
<hr>
<h3>Custom Input Control Range</h3>
<div class="row">
<div class="col-lg-5 col-md-5">
<input class="form-control" type="text" ez-datetime-control ng-model="form.from2" max-date="form.to2" placeholder="Select a start date..." ng-change="modelChanged()"/>
</div>
<div class="col-lg-1 col-md-1" style="text-align: center;">-</div>
<div class="col-lg-5 col-md-5">
<input class="form-control" ez-datetime-control type="text" ng-model="form.to2" min-date="form.from2" placeholder="Select a due date..." ng-change="modelChanged()"/>
</div>
</div>
<hr>
<h3>Standalone Datepicker</h3>
<div ez-date-picker ng-model="form.date5" start-view="year" style="border: 1px solid #ccc; border-radius: 5px;" ng-change="modelChanged()"></div>
<br>
Model value => {{ form.date5 || 'null' }}
<hr>
<h3>Standalone Timepicker</h3>
<div ez-time-picker ng-model="form.time1" seconds-enabled="true" ng-change="modelChanged()"></div>
<br>
Model value => {{ form.time1 || 'null' }}
</div>
</body>
</html>