javascript - How can I check if a Date datatype variable is in the past with Typescript? -
I have this function:
isAuthenticationExpired = (expiration date: date) = & Gt; {Var now = new date (); If (end date - now> 0) {return false; } And {return true; }}
There are two types of Typography calls me an error The left hand type of error should be 'any', 'number' or an enum type: / P> How can I check that the date has expired, as if my way does not work? expiration dates
and types now
error 3 arithmetic operation. Error 4 An arithmetic operation should have a 'no', 'number' or an enum type on the right side.
date
now
and of Em> After the UNIX Era of MS using the expiration date
.valueOf ()
var now = new date (). ValueOf (); End date = expiration date value ();
Alternatively, use date.now ()
Comments
Post a Comment