Created
October 28, 2016 04:49
-
-
Save brianswisher/9573a13ee8b721b906a839a06da9d6ac to your computer and use it in GitHub Desktop.
Get Timezone 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
| (() => { | |
| const libs = [ | |
| 'https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.6/jstz.min.js' | |
| ].map((src) => { | |
| return new Promise(resolve => { | |
| const script = document.createElement("script"); script.src = src; script.async = false; | |
| script.onload = () => { | |
| resolve(); | |
| }; | |
| document.head.appendChild(script); | |
| }); | |
| }); | |
| return Promise.all(libs).then(() => { | |
| console.info(jstz.determine().name()) | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment