Topic: mdb-date-picker fails to handle any start [ngModel] value except empty string
Arsenii pro asked 6 years ago
Here is html:
<mdb-date-picker name="date-picker" [options]="datePickerOptions" [placeholder]="'Date'" [(ngModel)]="date"></mdb-date-picker>
Here is typescript:
datePickerOptions = {
dateFormat: 'd mmm yyyy'
};
date = "";
If date is empty, date picker works correctly and after selecting or reselecting date displays and saves it in correct text format (eg "17 Mar 2018").
But if date is not empty before first date picker opening and still has date in set format (or ISO string), date picker displays
"-1 undefined -1" instead of date and can't work properly during date reselecting.
Add comment
Arsenii pro answered 6 years ago
Date picker can correctly select and change dates in format "d mmm yyyy" (eg "7 Mar 2018) but fails with such input.
To have possibility input dates you need to choose "dd mmm yyyy" (eg "07 Mar 2018) format.
Damian Gemza staff commented 6 years ago
Dear Arsenii, Unfortunately, for now, there's no possibility to put those dateFormat as initial date. We're working on improving this. Best Regards, DamianFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Answered
Specification of the issue
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Tags