Mercurial > gemma
diff client/src/lib/session.js @ 483:27502291e564
docs: Added comments on non trivial parts of the code
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 24 Aug 2018 10:50:58 +0200 |
parents | 4bf2173748f3 |
children |
line wrap: on
line diff
--- a/client/src/lib/session.js Fri Aug 24 10:08:49 2018 +0200 +++ b/client/src/lib/session.js Fri Aug 24 10:50:58 2018 +0200 @@ -1,10 +1,21 @@ +/** + * Compares whether session is current + * based on the expiry information and the + * current date + * + * @param {number} expiresFromPastSession + */ function sessionStillActive(expiresFromPastSession) { if (!expiresFromPastSession) return false; const now = Date.now(); const stillActive = now < expiresFromPastSession; return stillActive; } - +/** + * Converts a given unix time to Milliseconds + * + * @param {string} timestring + */ function toMillisFromString(timestring) { return timestring * 1000; }