How to set the default date of ion-datetime is today Ionic-v2

Thanks for reading! :blush:

you can do something like this. initialize new date in your component then use binding.

 myDate: String = new Date().toISOString();

<button> today date <ion-datetime displayFormat="YYYY-MM-DD" [(ngModel)]="myDate" (ionChange) = "mydate(myDate)"> </ion-datetime></button>

 mydate(event){
    //do something here
  }
2 Likes

thanks for your answer . But I have a question how to disable the days passed

Well, you got that answered in the second topic you created on this problem:

1 Like