Topic: Datepicker default value

tano pro asked 4 years ago


Hello,

I have a datepicker. My relevant initial options are.

{ 
startDate: '2019-10-13, closeAfterSelect: true
}

this cause : this.documentClickFun is not a function, due to in selectDate this method still not initialized.

Thanks,

tano


Bartosz Termena staff commented 4 years ago

Dear @tano

Could you provide more of your code? I can not reproduce your problem. Best Regards, Bartosz.


tano pro answered 4 years ago


Hello,

I don't have any special set up. I have a custom option i which I set the followings: in ts.

options: IMyOptions = {startDate: '2019-10-13', closeAfterSelect: true}

in html

<mdb-date-picker [options]="options" ></mdb-date-picker>

The problem is if I set closeAfterSelect to true it cannot close picker since it is not opened after initialization, but the init process and the date selection use the same selectDate method. I have a workaround, I set clickAfterSelect after the view inited and it works as expected, but it is a hack.

br,

tano


Bartosz Termena staff commented 4 years ago

Hi! To be sure - which version of MDB are you using? In my example (copy, paste your code above), everything works as it should (open date picker -> select date -> automatically close after select). Best Regards, Bartosz.


tano pro commented 4 years ago

latest. Works of course, but I have an error on console after initialization.



Please insert min. 20 characters.

FREE 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: 8.3.1
  • Device: PC
  • Browser: Chrome
  • OS: Win10
  • Provided sample code: No
  • Provided link: No