Topic: Having problem with MDB date picker's two way binding when using [(ngModel)] with a javascript Date object

Subrata Paul pro asked 5 years ago


Hi Support,

Having problem with MDB date picker's two way binding when using [(ngModel)] with a javascript Date object.

 

Ex: 

Html :
<mdb-date-picker name="dp" [(ngModel)]="model_dp" required></mdb-date-picker>
 
Component : 
model_dp : Date;
 
Output :  
When selecting from calendar - 19-12-2018
When assigning through model - 19-0-1--1
 
 
 
Regards,
Subrata Paul

Arkadiusz Idzikowski staff answered 5 years ago


Hello,

Please try to pass object instead of string to ngModel. For example:

model = { date: { year: 2018, month: 10, day: 15 } };

Subrata Paul pro commented 5 years ago

Dear Arkadiusz Idzikowski,

I'm passing java script Date object .  


Arkadiusz Idzikowski staff commented 5 years ago

Please show me the example of the object you pass to the ngModel variable. 

Did your method of date modification work in previous versions or is it feature request?


Subrata Paul pro answered 5 years ago


Dear support team,

I'm waiting for your solution.

 

Regards, 

Subrata Paul



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: 7.0.0
  • Device: Windows
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No