<!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>Using a <code><DIV></code> element</label>
<div class="form-control"
moment-picker="ctrl.div.stringDate"
format="YYYY-MM-DD"
locale="en">
<a class="pull-right"
ng-if="ctrl.div.stringDate"
ng-click="ctrl.div.stringDate = ''">
×
</a>
<span ng-class="{'text-muted': !ctrl.div.stringDate}">
{{ ctrl.div.stringDate || 'Select a date...' }}
</span>
</div>
<div class="help-block small">
<b>Note:</b> since this is not an input field, users cannot type
custom text.
</div>
</div>
<hr>
<div class="form-group">
<label>Using a <code><INPUT></code> element</label>
<input class="form-control"
placeholder="Select a date..."
moment-picker="ctrl.input.stringDate"
locale="en"
format="YYYY-MM-DD"
ng-model="ctrl.input.momentDate"
ng-model-options="{ updateOn: 'blur' }">
<div class="help-block small">
<b>Note:</b> <code>ng-model</code> is required for inputs,
even if you never use it.
</div>
</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;
// noop.
}]);
# 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