Why ion time doesn't refresh to current time?

Hi, I used Ion-DateTime to let the user pick a time. I would like to have the current time + 20 minutes, for this, I tested to add this in function ionViewWillEnter(), this works in console but does not work for the user.
Why the HTML does not refresh. Can you help please ?

This is the code :

 ionViewWillEnter() {
this.minAfter.setMinutes(this.minAfter.getMinutes() + 20)

    <ion-label>Heure de retrait</ion-label>
    <ion-datetime (click)="setHour()" displayFormat="H:mm"  max="22:30Z" min="{{minAfter| date: 'H:mm'}}" ></ion-datetime>

Thanks !

You need to use [attribute_name] to bind the variable, ie: [min]="minAfter"

1 Like

Thank you, I tried and didn’t work though
still the same i have the good hour in consol but no in picker

Pretty sure you have to convert it to an ISO string.

1 Like