title: Implementing a 15 minute timeout in React issues
body: <p>I'm implementing a Save feature on a form I'm creating in React. When a User clicks save on a form, I want them to type the username/password. The next time that same user tries to save, if it's been under 15 minutes, I want them to not have to sign the save username/password. If it's over 15, I want them to authenticate again.</p>
  <p>I stumbled across this code on a different stackoverflow question about timeouts.</p>
  <pre><code>   calculateHours(date1 , expireTime){
              const dateOne = date1;
              const dateTwo = new Date();
              const dateOneObj = new Date(dateOne);
              const dateTwoObj = new Date(dateTwo);
              const hours = Math.abs(dateTwoObj - dateOneObj)/ 36e5;
              const minutes = hours/ 36e5;
              return expireTime &gt; hours ? true : false
          }
  </code></pre>
  <p>Code for defining the 15 minute timeout currently.</p>
  <pre><code>  if(this.calculateHours(localStore.time , 15)){
                              this.wrappedClickHandler()
  </code></pre>
  <p>This is for a 15 minute timeout, but the code is really sloppy and ugly and I was wondering if anyone has a better way of implementing this?</p>