view client/src/lib/session.js @ 285:8e22d1f16f81 usermanagement

refactor: better variable naming In order to achieve more consistent style all boolean getter functions were renamed according JS style and is-prefixed. Sidebar collapsed renamed to isCollapsed.
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 31 Jul 2018 09:36:15 +0200
parents 4bf2173748f3
children 27502291e564
line wrap: on
line source

function sessionStillActive(expiresFromPastSession) {
  if (!expiresFromPastSession) return false;
  const now = Date.now();
  const stillActive = now < expiresFromPastSession;
  return stillActive;
}

function toMillisFromString(timestring) {
  return timestring * 1000;
}

export { sessionStillActive, toMillisFromString };