material icon indicating copy to clipboard operation
material copied to clipboard

md-datepicker should accept null value for date initialization.

Open mnanzawa opened this issue 11 years ago • 4 comments

The md-datepicker returns null when date is not selected. It should also accept null value for date initialization. Currently, if I set null to required date value, it won't accept (it won't even initialize).

Sample: https://codepen.io/anon/pen/xwLPbP

mnanzawa avatar Oct 12 '15 16:10 mnanzawa

mnanzawa this has bee fixed it supports it now pull latest

change your js code in codepen too: angular.module('MyApp').controller('AppCtrl', function($scope) { $scope.myDate = null;

$scope.minDate = new Date();

$scope.maxDate = new Date(); });

jsdev avatar Oct 19 '15 21:10 jsdev

Thank you very much.

Confirmed with the HEAD version. It now accepts null as the start value. If the initial value is set to null, text input field shows "Enter date" as expected.

mnanzawa avatar Oct 19 '15 21:10 mnanzawa

How to set calendar to past month when user first time open it? In our situation we have date of birth and other date option which should be of back date so we can apply max-date but when calendar open it shows half of current month and half of next month which is disable due to which we received lot of complain tickets.

Please help me.

mkakkar81 avatar Sep 15 '16 16:09 mkakkar81

Thank you very much @jsdev,Your solution is fabulas. You were very helpful for me

piyushsinghal1993 avatar Jan 24 '17 07:01 piyushsinghal1993