-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in frontend chart highlight current users line
Co-authored-by: Moritz Bergmann <[email protected]>
- Loading branch information
1 parent
d091fc6
commit 3ce72f5
Showing
4 changed files
with
43 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// https://stackoverflow.com/questions/14573223/set-cookie-and-get-cookie-with-javascript | ||
export function setCookie(name,value,days) { | ||
let expires = ""; | ||
if (days) { | ||
let date = new Date(); | ||
date.setTime(date.getTime() + (days*24*60*60*1000)); | ||
expires = "; expires=" + date.toUTCString(); | ||
} | ||
document.cookie = name + "=" + (value || "") + expires + "; path=/"; | ||
} | ||
|
||
export function getCookie(name) { | ||
let nameEQ = name + "="; | ||
let ca = document.cookie.split(';'); | ||
for (let i=0; i < ca.length; i++) { | ||
let c = ca[i]; | ||
while (c.charAt(0)==' ') c = c.substring(1,c.length); | ||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); | ||
} | ||
return null; | ||
} | ||
|
||
function eraseCookie(name) { | ||
document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; | ||
} |