forked from alanjhonnes/angular-moment-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoment.html
100 lines (92 loc) · 5.09 KB
/
moment.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="dist/angular-moment-picker.css"/>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/angular/angular.js"></script>
<!--<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>-->
<!--<script src="js/momentPicker.mdl.js"></script>-->
<!--<script src="js/momentPicker.js"></script>-->
<!--<script src="js/momentUtils.js"></script>-->
<!--<script src="js/momentInput.js"></script>-->
<script src="dist/angular-moment-picker.js"></script>
<script>
angular.module('sample', ['momentPicker'])
.controller('TestCtrl', ['$scope', 'momentUtils', function ($scope, momentUtils) {
var vm = this;
//vm.now = moment();
//vm.endTime = moment();
//vm.offset = moment(new Date()).format('ZZ');
}]);
</script>
</head>
<body ng-app="sample">
<div class="container">
<div class="row" ng-controller="TestCtrl as vm">
<div class="col-md-6">
<div>
<form id="inputform" name="vm.form" novalidate>
<div class="input-group date" moment-time-append>
<!--<input name="endTime" id="inputEndTime" type="text" class="form-control" min="2020-11-11T11:11:11"-->
<!--moment-time ng-model="vm.endTime" required min-date="{{vm.now|date:'yyyy-MM-ddTHH:mm:ssZ'}}"-->
<!--max-view="year" view="date" min-view="minutes" auto-close="true"-->
<!--format="dd/MM/yy 'às' HH'h'mm'min'" date after="vm.now"-->
<!--before="vm.endTime"-->
<!--readonly>-->
<input name="endTime" id="inputEndTime" type="text" class="form-control"
moment-time ng-model="vm.endTime" required local="true"
max-view="year" view="year" min-view="minutes" min-moment="{{vm.now|moment}}"
format="DD/MM/YYYY [às] HH[h]mm[min]" auto-close="true"
readonly>
<!-- min-date="{{vm.now|date:'yyyy-MM-ddTHH:mm:ssZ'}}" -->
<div class="input-group-addon"><i class="fa fa-calendar"></i></div>
</div>
<div class="input-group date" moment-time-append>
<!--<input name="endTime" id="inputEndTime" type="text" class="form-control" min="2020-11-11T11:11:11"-->
<!--moment-time ng-model="vm.endTime" required min-date="{{vm.now|date:'yyyy-MM-ddTHH:mm:ssZ'}}"-->
<!--max-view="year" view="date" min-view="minutes" auto-close="true"-->
<!--format="dd/MM/yy 'às' HH'h'mm'min'" date after="vm.now"-->
<!--before="vm.endTime"-->
<!--readonly>-->
<input name="endTime" id="inputEndTime" type="text" class="form-control"
moment-time ng-model="vm.endTime" required local="false"
max-view="year" view="year" min-view="minutes"
format="DD/MM/YYYY [às] HH[h]mm[min]" auto-close="true"
readonly>
<!-- min-date="{{vm.now|date:'yyyy-MM-ddTHH:mm:ssZ'}}" -->
<div class="input-group-addon"><i class="fa fa-calendar"></i></div>
</div>
<!--<div moment-picker="vm.endTime" max-view="year" view="year" min-view="minutes"></div>-->
<div class="error-message" ng-show="vm.form.endTime.$error.required">
Selecionar a data final para envio de propostas.
</div>
<div class="error-message" ng-show="vm.form.endTime.$error.min">
Selecionar data futura.
</div>
<div class="error-message" ng-show="vm.form.endTime.$error.max">
Selecionar menor data maxima.
</div>
<pre>{{vm.form.endTime.$error|json}}</pre>
<pre>{{vm.form | json}}</pre>
<pre>{{vm.now}}</pre>
<pre>{{vm.endTime}}</pre>
</form>
</div>
</div>
<div class="col-md-6">
<pre>{{vm.now|moment}} vm.now|moment</pre>
<pre>{{vm.endTime|moment}} vm.endTime|moment</pre>
<pre>{{vm.endTime|momentUTC}} vm.endTimeUTC|momentUTC </pre>
<pre>{{vm.endTime|date:'dd/MM/yy' }}vm.endTimeUTC|date:'dd/MM/yy' </pre>
<pre>{{vm.offset}} vm.offset</pre>
</div>
</div>
</div>
</body>
</html>