I want to set the date picker value in my component, so I’ve written this code but its not working (Cannot read property ‘month’ of null"):
HTML:
<ion-datetime
required
min="minDate"
max="maxDate"
name="targetDate"
displayFormat="MMM DD YYYY"
mode=“date”
[(ngModel)]=“swapDay.targetDate”>
</ion-datetime>
TS:
public minDate = “2016-01-01”;
public maxDate = “2017-01-01”;