components
components copied to clipboard
bug(material/core): Luxon date adapter not support initial Luxon DateTime object
Is this a regression?
- No
Description
When I use Luxon DateTime object to init form control date is not visible in the datepicker.
Reproduction
- Create form control with luxon DateTime
luxonControl = new FormControl(DateTime.now())
- Add this control to datepicker
<mat-form-field>
<mat-label>Luxon datepicker</mat-label>
<input matInput [matDatepicker]="dp" [formControl]="luxonControl" />
<mat-hint>MM/DD/YYYY</mat-hint>
<mat-datepicker-toggle matSuffix [for]="dp"></mat-datepicker-toggle>
<mat-datepicker #dp></mat-datepicker>
</mat-form-field>
- Date is not visible in UI
Expected Behavior
Luxon DateTime should be parsed in deserialize
method.
Here is my fork with edited code I just messed up the commit message and I don't have local environment so if somebody can test it, it would be great.
https://github.com/angular/components/compare/main...Vevl:components:vevl-patch
Actual Behavior
Datepicker not showing the date if there is a Luxon DateTime object as input.
Environment
- Angular: ~14.2.0
- CDK/Material: ^14.2.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows