Having two dates, firstDate and secondDate, I want to check if a new one is situated between these two but I keep getting errors.
My approach:
export class AppComponent {
first = "20171212";
second = "20181212";
firstDate = new Date(this.first);
secondDate = new Date(this.second);
check = "20180101";
checkDate = new Date(this.check);
if( this.checkDate > this.firstDate && this.today < this.secondDate) {
return true;
}
}
The error message says that it cannot be used the dot notation in this.checkDate
and the others.
Any ideas why is this wrong?