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 expiration dates and types now

Typography calls me an error The left hand type of error should be 'any', 'number' or an enum type: / P>

  error 3 arithmetic operation. Error 4 An arithmetic operation should have a 'no', 'number' or an enum type on the right side.  

How can I check that the date has expired, as if my way does not work?

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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -