Angular UI date-picker min Date is not working

可紊 提交于 2019-12-13 02:06:46

问题


I am using angular 1.0.8. I want to use angular ui datepicker. I want to set minimum date to yesterday.

I had tried min-date option like "min-date='-1d'" but it's not working.

Does anyone have this issue? I need help in setting min-date option.

Thanks and regards,

Jay Patel


回答1:


I am using angular.ui 0.10.0 version and it's having "min" instead of "min-date". I changed "min-date" to "min" as per comment and it's working properly




回答2:


In your Controller you can write ,Use the latest version of date picker from Angular UI it will work , its an example of date of Birth selection

min-date="'01/01/1901'"  max-date="maxDate"

$scope.toggleMax = function() { $scope.maxDate = $scope.maxDate ? null : new Date(); }; $scope.toggleMax();



来源:https://stackoverflow.com/questions/25445786/angular-ui-date-picker-min-date-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!