Topic: datepicker bug
ammi pro asked 3 weeks ago
if you select format "mm/dd/yy" datepicker displays data correctly. If you insert new data it populates and display data correctly, but if you update existing data it will be populated with invalid 2-digit year. For example, if data.nextDate (public nextDate!: Date | null;) is null and I click on datepicker and select December 31, data.nextDate will be 12/31/2024. If data.nextDate is 12/31/2024, it will be displayed correctly as 12/31/24. However, if I click on datepicker and change date to December 30, data.nextDate will be 12/30/24 instead of 12/30/2024. If I click Clear button first and then select December 30, data.nextDate will be 12/30/2024. Please fix this bug. Thank you.
<mdb-form-control>
<input
[(ngModel)]="data.nextDate"
mdbInput
[mdbDatepicker]="dpNextDate "
type="text"
class="form-control"
(keydown)="false"
(click)="dpNextDate .open()"
/>
<mdb-datepicker-toggle [mdbDatepicker]="dpNextDate "></mdb-datepicker-toggle>
<mdb-datepicker #dpNexDate
[confirmDateOnSelect]="true"
[removeClearBtn]="false"
[format]="'mm/dd/yy'">
</mdb-datepicker>
</mdb-form-control>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Opened
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: MDB5 6.1.0
- Device: Desktop
- Browser: Chrome
- OS: W1-
- Provided sample code: No
- Provided link: No
Arkadiusz Idzikowski staff commented 2 weeks ago
I added this to our to-do list. We will check that and let you know what we found (or add a fix).