This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
This file contains hidden or 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
| (function closureExample() { | |
| // Closure | |
| function a() { | |
| var b = 10; | |
| return function c(d){ | |
| return b+d; | |
| } | |
| } |
This file contains hidden or 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
| * https://auth0.com/blog/what-is-and-how-does-single-sign-on-work/ | |
| * https://www.ru.nl/publish/pages/769526/z_researchpaper_sso_final_nick_heijmink_s4250559.pdf |
This file contains hidden or 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
| var tzMap = { | |
| "Afghanistan (Kabul)": "Asia/Kabul", | |
| "Alaska Time": "US/Alaska", | |
| "Atlantic Time": "Brazil/West", | |
| "Atlantic Time (Bermuda)": "Atlantic/Bermuda", | |
| "Australian Central Time (Adelaide)": "Australia/Adelaide", | |
| "Australian Central Time (Northern Territory)": "Australia/North", | |
| "Australian Eastern Time (Queensland)": "Australia/Queensland", | |
| "Australian Eastern Time (Sydney)": "Australia/Sydney", | |
| "Australian Western Time": "Australia/West", |
This file contains hidden or 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
| // date string with time zone. Apply UTC offset after moment is created | |
| // without applying UTC offset, the format() method will return hours and date formated as per local time | |
| moment("14/03/2016 +0130","DD/MM/YYYY Z").utcOffset("+0130") |
This file contains hidden or 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
| // Local time zone is Asia/Kolkata with offset GMT +0530 | |
| var dt = "14/03/2016"; | |
| var dtz = "14/03/2016 +0130"; | |
| var tz = "+0130"; | |
| var df = "DD/MM/YYYY"; | |
| var dfz = "DD/MM/YYYY Z"; | |
| var d1 = moment(dtz,dfz); // date string with time zone | |
| var d2 = moment(dt,df); // date string without timezone |