<!DOCTYPE html>
<html ng-app="Demo" style="height:100%;">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Angular Moment Picker</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="//rawgit.com/indrimuska/angular-moment-picker/master/dist/angular-moment-picker.css" rel="stylesheet">
</head>
<body ng-cloak style="padding:20px;"
ng-controller="DemoController as ctrl">
<div class="form-group">
<label>Max date as string <code>{{ctrl.maxDateString}}</code></label>
<input class="form-control"
placeholder="Select a date..."
moment-picker="ctrl.first.stringDate"
locale="en"
format="YYYY-MM-DD"
start-view="month"
max-date="ctrl.maxDateString"
ng-model="ctrl.first.momentDate"
ng-model-options="{ updateOn: 'blur' }">
</div>
<hr>
<div class="form-group">
<label>Max date as Moment.js object</label>
<input class="form-control"
placeholder="Select a date..."
moment-picker="ctrl.second.stringDate"
locale="en"
format="YYYY-MM-DD"
start-view="month"
max-date="ctrl.maxDateMoment"
ng-model="ctrl.second.momentDate"
ng-model-options="{ updateOn: 'blur' }">
</div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment-with-locales.js"></script>
<script src="//rawgit.com/indrimuska/angular-moment-picker/master/dist/angular-moment-picker.js"></script>
<script src="script.js"></script>
</body>
</html>
angular
.module('Demo', ['moment-picker'])
.controller('DemoController', ['$scope', function () {
var ctrl = this;
// set maximum date to tomorrow
ctrl.maxDateMoment = moment().add(1, 'day');
ctrl.maxDateString = moment().add(1, 'day').format('YYYY-MM-DD');
}]);
# Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
### More info at:
https://github.com/indrimuska/angular-moment-picker