This seems to be a common issue, but none of the posts I found helped me with this problem. I've coded the angular date-picker into my html component and don't have anything in the css files, but I can't type in a date, the cursor in the input never appears and the calendar icon never appears. I can click where the calendar icon is supposed to be and a calendar does pop up, but it doesn't have the title headers where you can change the month and year.
I'm pretty sure the code is right because when I tried it on stackblitz it worked fine. My guess is there is something with the way I have my angular project setup. Any ideas?
I've imported FormsModule, MatDatepickerModule, MatFormFieldModule, MatInputModule, MatNativeDateModule, MatRippleModule, MatIconModule, which I think is everything.
My package.json has @angular/material:^13.3.9, which should be the latest.
<!DOCTYPE html>
<html>
<div *ngIf="isSignedIn">
<mat-form-field appearance="fill">
<mat-label>Choose a date</mat-label>
<input matInput [matDatepicker]="picker">
<mat-hint>MM/DD/YYYY</mat-hint>
<mat-datepicker-toggle matIconSuffix [for]="picker" style="background:blue"></mat-datepicker-toggle>
<mat-datepicker #picker color="primary"></mat-datepicker>
</mat-form-field>
</div>
</html>
<div *ngIf="!isSignedIn">
<app-login></app-login>
</div>
This is what I've looked into and I have tried everything on these pages with no luck.
- Angular Material Date-Picker is not working properly
- Angular matdatepicker is not displaying like it should
- Angular Material Datepicker won't show in the page 4.https://stackoverflow.com/questions/74824227/angular-material-datetime-picker-not-showing-icons
Any more ideas?