Ionic set Max date to 6 days later


How to set max date on ionic to 1 week from today.
Example: if today is 01-01-2018, I wan to set max date to 07-01-2018
I try with this one on my .ts and I got error.
public maxDate(){
return new date() + 6;


Are you referring to the ion datetime object, or are you referring to the datepicker in ionic native?


Im referring to ionic datepicker.
this is my html code

      <ion-label floating>Date</ion-label>
      <ion-datetime displayFormat="DD-MM-YYYY" 
[(ngModel)]="" [min]="today()"></ion-datetime>


Here’s a working example with +2 years, I think, to remake for days you will not be difficult:

maxDate: any = new Date(new Date().setFullYear(new Date().getFullYear() + 2)).toISOString();


Thanks brother, it’s work.