Open paul-lmsg opened 3 years ago
Hello, I'm trying to display correct french date format with leading zero for day and month when < 10 using moment adapter but it's not working, here is my code :
providers: [ // DATETIME PICKER { provide: NGX_MAT_DATE_FORMATS, useValue: NGX_MAT_MOMENT_FORMATS }, { provide: NgxMatDateAdapter, useClass: NgxMatMomentAdapter }, ],
<mat-form-field appearance="fill"> <mat-label>{{ 'departure_time' | transloco }}</mat-label> <input matInput [ngxMatDatetimePicker]="picker" placeholder="{{ 'departure_time' | transloco }}" [formControl]="dateFormControl" /> <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <ngx-mat-datetime-picker #picker> </ngx-mat-datetime-picker> </mat-form-field>
The left element is what I get and the right is what I want, it's the result of dateFormControl.value.format('L') using moment.js
dateFormControl.value.format('L')
How can I achieve that ?
Any updates?
Hello, I'm trying to display correct french date format with leading zero for day and month when < 10 using moment adapter but it's not working, here is my code :
The left element is what I get and the right is what I want, it's the result of
dateFormControl.value.format('L')
using moment.jsHow can I achieve that ?