I need an AngularJS date picker that allows me to do the following, default the available dates (min and max), blank by default so the user has to enter a date if required, and for the user to be able to select the date from a calender control OR enter it manually. I thought I nearly had it with the following supposid out of the box component however when you try to manually enter a date you get some weird results. It looks like its using US format when you manually enter the date but UK when you use the calender. if you enter 28-03-2017 it saves it as 2019-04-03T08:11:07.366Z, something clearly isn't correct, Please help if you can.
Codepen: http://codepen.io/petemossuk/pen/mRNKpv
<ul class="dropdown-menu">
<li><a href="/javascript-minify">Javascript Minify</a>
</li>
<li><a href="/css-minify">CSS Minify</a>
</li>
<li><a href="/css-beautify">CSS Beautify</a>
</li>
<li><a href="/javascript-beautify">Javascript Beautify</a>
</li>
<li><a href="/html-beautify">HTML Beautify</a>
</li>
<li><a href="/perl-beautify">Perl Beautify</a>
</li>
<li><a href="/php-beautify">PHP Beautify</a>
</li>
<li><a href="/go-beautify">GO Beautify</a>
</li>
<li><a href="/ruby-beautify">Ruby Beautify</a>
</li>
<li><a href="/sql-beautify">SQL Beautify</a>
</li>
<li><a href="/xml-beautify">XML Beautify</a>
</li>
angular.module('MyApp',['ngMaterial', 'ngMessages', 'material.svgAssetsCache'])
.config(function $mdDateLocaleProvider) { $mdDateLocaleProvider.formatDate = function (date) {
return !date ? '' : moment(date).format('DD-MM-YYYY');
};})
.controller('AppCtrl', function() { this.myDate = new Date();});