Topic: DatePicker problem
HTML:
<mdb-date-picker name="mydate"
[options]="myDatePickerOptions"
[(ngModel)]="date"
[inline]="true">
TS:export class MyDatePickerComponent {
date: Date = new Date();
public myDatePickerOptions: IMyOptions = {
dateFormat: 'dd/mm/yyyy',
startDate: this.date.toISOString()
};}
The start date doesn't show, butif we comment the dateFormat option line it does.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Open
Specification of the issue
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: 8.2.0
- Device: Desktop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No
Tags
Related topics
Arkadiusz Idzikowski staff commented 4 years ago
What value is passed to the
ngModel
withdate
variable?adeo commented 4 years ago
All code is what you see there's nothing else
date: Date = new Date();
so it should be the current date.
Arkadiusz Idzikowski staff commented 4 years ago
As you can see in our changelog, we added the possibility to use Javascript Date Object in version 8.3.0. If you use 8.2.0, please try to update your MDB Angular version and let us know if that helped.
https://mdbootstrap.com/docs/angular/changelog/#830
Pierre K commented 4 years ago
Hey, Me I use the version 10.0.0 but I have the same problem. the Date Work only when I comment the dateFormat option. I use MDB-Pro with Angular and I already open a ticket for that but I didn't have any good response. Here is the link for my ticket : https://mdbootstrap.com/support/angular/problem-with-mdb-date-picker-option-error/
Regards.
Arkadiusz Idzikowski staff commented 4 years ago
@Pierre K I answered in your thread. The problem in your case is probably different if you use the latest version.