Ionic2 datetime not updating in view when bound variable changes


#1

ion-datetime is bound to the variable this.days[index].hm when below function is called ion-datetime does not show the user’s new datetime value in the view.

Method:

  changeDateTimeValueFromCode(index: number) {
        this.days[index].hm = '15'+ ':' + '20';
      }
    }

View: new value for day.hm not displayed

<ion-card *ngFor="let day of days">
      <ion-item>
        <ion-label>Time worked hours/min</ion-label>
        <ion-datetime displayFormat="H:mm" (ionChange)="TestUserChange(day.index)" [(ngModel)]="day.hm"></ion-datetime>
      </ion-item>
</ion-card>

#2

Can you try putting a full ISO8601 string (not just hh:mm) in the backing property?