title: User Login time restriction
body: <p>I have shifts in my application. I want to restrict the time that a user can log in to their defined log in time span. </p>
  
  <p>Shift 1 which is AM to PM is working fine, but PM to AM check is creating problems. This is because the second shift starts at 5.00 PM and ends on next day on 10.00am.</p>
  
  <p>The user table structure is </p>
  
  <pre><code>shiftid,  starttime,  endtime
  1,        6:00:00 AM, 11:30:00 PM
  2,        5:00:00 PM, 10:00:00 AM
  </code></pre>