0
I’m using Angular Material
in a project and need to collect the user’s date of birth in the register, I am trying to use the Datepicker
of Material
, but the field doesn’t even appear on the screen. I’m 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;
};
There is some error in the console?
– DiegoAugusto
No error in the console, the datepicker field simply does not appear, but loads into html
– Felipe Paetzold
Imported all necessary libs? I ran a jsfiddle test and it appeared at first
– DiegoAugusto
https://jsfiddle.net/suunyz3e/328/
– DiegoAugusto
@Diegoaugusto actually I was using a wrong version, but thank you.
– Felipe Paetzold