Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.

Commit f30b71c

Browse files
committed
checking dateformat
1 parent d8404af commit f30b71c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

demo/index.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,29 @@
1010

1111
<body ng-app="ui.date">
1212
<!-- Date -->
13+
<div ng-controller='MyCtrl'>
1314
<label for="date">Select Date:</label>
14-
<input type="text" id="date" ui-date ng-model="aDate">
15+
<input type="text" id="date" ui-date="dateOptions"ng-model="aDate">
1516

1617
<div>{{ aDate }}</div>
17-
18+
<a href="#" ng-click="logDate()">log date</a>
19+
</div>
1820
<!-- Scripts -->
1921
<script type="text/javascript" src="bower_components/jquery/dist/jquery.js"></script>
2022
<script type="text/javascript" src="bower_components/jquery-ui/jquery-ui.min.js"></script>
2123
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
2224
<script type="text/javascript" src="assets/date.js"></script>
25+
<script>
26+
angular.module('ui.date').controller('MyCtrl', function($scope) {
27+
$scope.aDate = new Date();
28+
$scope.dateOptions = {
29+
dateFormat: 'dd-mm-yy'
30+
}
31+
$scope.logDate = function(){
32+
console.log($scope.aDate);
33+
}
34+
})
35+
</script>
2336
</body>
2437

2538
</html>

0 commit comments

Comments
 (0)