forked from adamalbrecht/ngQuickDate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
57 lines (55 loc) · 2.15 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
<!DOCTYPE html>
<html data-ng-app='ngQuickDateDemo'>
<head>
<title>ngQuickDate Demo</title>
<link rel="stylesheet" type="text/css" href="dist/ng-quick-date-plus-default-theme.css" media="all" />
<style type="text/css">
form.ng-dirty .ng-invalid .quickdate-button {
border: solid 1px red;
}
</style>
</head>
<body>
<div ng-controller='DemoCtrl'>
<form name='date_form' novalidate>
<p>
<label>My Date</label>
<quick-datepicker name='myDate' ng-model='myDate' min-date='minDate' max-date='maxDate' required></quick-datepicker>
</p>
<p>
<label>Some other field</label>
<input type='text' name='otherField' ng-model='otherField' required />
</p>
</form>
<br/>
<br/>
<a href='' ng-click='setToToday()'>Set Date to Today</a><br/>
<a href='' ng-click='setMinDate()'>Set Min Date To Today</a><br/>
<a href='' ng-click='setMaxDate()'>Set Max Date To Today</a><br/>
</div>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<!-- <script type='text/javascript' src='vendor/sugar.js' /> -->
<!-- <script type='text/javascript' src='vendor/date.js' /> -->
<!-- <script type='text/javascript' src='bower_components/jquery/jquery.js' /> -->
<script type='text/javascript' src='dist/ng-quick-date.js'></script>
<script type='text/javascript'>
var app = angular.module("ngQuickDateDemo", ["ngQuickDate"]);
app.config(function(ngQuickDateDefaultsProvider) {
return ngQuickDateDefaultsProvider.set({
disableTimepicker: true,
disableOther: true
});
});
app.controller("DemoCtrl", function($scope) {
$scope.myDate = null
$scope.minDate = null
$scope.maxDate = null
var today = new Date();
today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
$scope.setToToday = function() { $scope.myDate = today; }
$scope.setMinDate = function() { $scope.minDate = today; }
$scope.setMaxDate = function() { $scope.maxDate = today; }
});
</script>
</body>
</html>