I have a method on visual studio code like this and when I run program, The program allows me to rent a product before the current time and I know new Date()
method doesn't work on here
how can I solve this?
rent() {
if (
this.rentDate > this.returnDate ||
this.rentDate <new Date()||
!this.rentDate||
!this.returnDate
) {
this.toastrService.warning(
'Invalid dates'
);
return;
}
}