I'm using Angular Material
in a project and need to collect the user's date of birth in the registry, I'm trying to use Datepicker
of Material
, but the field does not even appear on the screen. Am I doing what's wrong?
HTML:
<div layout-gt-xs="row">
<div flex-gt-xs>
<label>Data de nascimento</label>
<md-datepicker ng-model="birth" md-placeholder="Data de nascimento"></md-datepicker>
</div>
</div>
JavaScript:
$scope.user.birth = new Date();
$scope.minDate = new Date(
$scope.birth.getFullYear(),
$scope.birth.getMonth() - 2,
$scope.birth.getDate());
$scope.maxDate = new Date(
$scope.birth.getFullYear(),
$scope.birth.getMonth() + 2,
$scope.birth.getDate());
$scope.onlyWeekendsPredicate = function(date) {
var day = date.getDay();
return day === 0 || day === 6;
};