I am using angular 8 application and I have this function:
checkExpired(echeq: EcheqSubmissionApi) {
const today = Date.now();
const validUntil = echeq.validUntilUtc;
if (validUntil < today) {
echeq.status = EcheqSubmissionStatus.EXPIRED;
return true;
}
return false;
}
and
validUntilUtc?: Date;
But I get this error:
Operator '<' cannot be applied to types 'Date' and 'number'.ts(2365)
on this line:
if (validUntil < today) {
How to correct this?