DatePicker problem


Topic: DatePicker problem

adeo pro premium asked 5 months ago

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.


Arkadiusz Idzikowski staff commented 5 months ago

What value is passed to the ngModel with date variable?


adeo pro premium commented 5 months 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 5 months 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 5 months 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 5 months ago

@Pierre K I answered in your thread. The problem in your case is probably different if you use the latest version.


Please insert min. 20 characters.
Status

Open

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: Angular
  • MDB Version: 8.2.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No
Tags