{"version":3,"sources":["components/ListTimeItem.jsx","App.jsx","index.js"],"names":["ListTimeItem","props","useState","time","setTime","locationFormatted","setLocationFormatted","useEffect","l","zone","split","moment","utc","Date","now","tz","format","setInterval","newTime","className","replace","excludeTZ","ReactGA","initialize","pageview","window","location","pathname","search","App","theme","setTheme","zones","setZones","noZones","setNoZones","mainTime","setMainTime","mainTZ","setMainTZ","setLocation","mainProcess","useCallback","Promise","resolve","tempZones","i","names","forEach","hours","includes","push","length","then","data","sort","a","b","aTime","bTime","minutes","seconds","curTime","slice","switchTheme","document","documentElement","classList","add","setAttribute","localStorage","setItem","event","category","action","setTimeout","remove","getItem","style","textAlign","map","onClick","xmlns","enableBackground","height","viewBox","width","fill","d","url","marginRight","bgColor","href","target","rel","year","ReactDOM","render","StrictMode","getElementById"],"mappings":"2SAqCeA,MA/Bf,SAAsBC,GAClB,MAAwBC,mBAAS,IAAjC,mBAAOC,EAAP,KAAaC,EAAb,KACA,EAAkDF,mBAAS,IAA3D,mBAAOG,EAAP,KAA0BC,EAA1B,KAkBA,OAhBAC,qBAAU,WACN,IAAIC,EAAIP,EAAMQ,KAAKC,MAAM,KACzBJ,EAAqB,GAAD,OAAIE,EAAE,GAAN,aAAaA,EAAE,KAEnCJ,EAAQO,IAAOC,IAAI,IAAIC,KAAKA,KAAKC,QAAQC,GAAGd,EAAMQ,MAAMO,OAAO,WAQ/DC,aANA,WAEI,IAAIC,EAAUP,IAAOC,IAAI,IAAIC,KAAKA,KAAKC,QAAQC,GAAGd,EAAMQ,MAAMO,OAAO,UACrEZ,EAAQc,KAGY,OACzB,CAACjB,EAAMQ,OAIN,qBAAKU,UAAU,eAAf,SACI,8BAAG,sBAAMA,UAAU,WAAhB,SAA4Bd,EAAkBe,QAAQ,IAAI,OAAY,sBAAMD,UAAU,OAAhB,SAAwBhB,UClBvGkB,EAAY,CACjB,4BACA,gBACA,aACA,MACA,aACA,UACA,YACA,OACA,MACA,OACA,MACA,MACA,KACA,MACA,UACA,UACA,MACA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EACA,sBACCmD,QAASjB,EACT7C,UAAU,aACV+D,MAAM,6BACNC,iBAAiB,gBACjBC,OAAO,OACPC,QAAQ,YACRC,MAAM,OACNC,KAAK,UARN,UAUC,sBAAMA,KAAK,OAAOH,OAAO,KAAKE,MAAM,OACpC,sBAAME,EAAE,oWAGT,sBACCP,QAASjB,EACT7C,UAAU,aACV+D,MAAM,6BACNC,iBAAiB,gBACjBC,OAAO,OACPC,QAAQ,YACRC,MAAM,OACNC,KAAK,UARN,UAUC,sBAAMA,KAAK,OAAOH,OAAO,KAAKE,MAAM,OACpC,sBAAME,EAAE,2+BAGV,uBAAMrE,UAAU,QAAhB,UACC,cAAC,aAAD,CACCsE,IAAI,wCACJX,MAAO,CAAEM,OAAQ,GAAIE,MAAO,GAAII,YAAa,YAE9C,cAAC,aAAD,CACCD,IAAI,kCACJX,MAAO,CAAEM,OAAQ,GAAIE,MAAO,GAAII,YAAa,UAC7CC,QAAmB,SAAV7D,EAAmB,OAAS,OAEtC,cAAC,aAAD,CACC2D,IAAI,yDACJX,MAAO,CAAEM,OAAQ,GAAIE,MAAO,GAAII,YAAa,YAE9C,oBACCE,KAAK,kCACLC,OAAO,SACPC,IAAI,aAHL,0BAKiBnF,IAAOE,KAAKC,OAAOiF,iBCzOxCC,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFjC,SAASkC,eAAe,W","file":"static/js/main.8882f128.chunk.js","sourcesContent":["import React, { useEffect, useState } from 'react';\r\nimport PropTypes from 'prop-types'\r\nimport moment from 'moment-timezone';\r\n\r\nimport './ListTimeItem.css';\r\n\r\nfunction ListTimeItem(props){\r\n const [time, setTime] = useState('');\r\n const [locationFormatted, setLocationFormatted] = useState('');\r\n\r\n useEffect(() => {\r\n var l = props.zone.split('/');\r\n setLocationFormatted(`${l[1]}, ${l[0]}`);\r\n\r\n setTime(moment.utc(new Date(Date.now())).tz(props.zone).format('h:mm a'));\r\n\r\n function updateTime(){\r\n //moment.utc(new Date(Date.now())).tz('Australia/Brisbane').format()\r\n var newTime = moment.utc(new Date(Date.now())).tz(props.zone).format('h:mm a');\r\n setTime(newTime);\r\n }\r\n\r\n setInterval(updateTime, 1000 * 10);\r\n }, [props.zone]);\r\n\r\n\r\n return (\r\n
\r\n

{locationFormatted.replace('_',' ')}{time}

\r\n
\r\n )\r\n}\r\n\r\nListTimeItem.propTypes = {\r\n zone : PropTypes.string\r\n}\r\n\r\nexport default ListTimeItem;","import React, { useCallback, useEffect, useState } from \"react\";\r\nimport { SocialIcon } from \"react-social-icons\";\r\nimport moment from \"moment-timezone\";\r\nimport ReactGA from \"react-ga\";\r\n\r\nimport \"./App.css\";\r\n\r\nimport ListTimeItem from \"./components/ListTimeItem\";\r\n\r\n// Any timezones in here will be excluded, this is usually ambigous ones are they don't format nicely.\r\nconst excludeTZ = [\r\n\t\"Antarctica/DumontDUrville\",\r\n\t\"Australia/LHI\",\r\n\t\"Etc/GMT-14\",\r\n\t\"HST\",\r\n\t\"Etc/GMT-13\",\r\n\t\"NZ-CHAT\",\r\n\t\"Universal\",\r\n\t\"W-SU\",\r\n\t\"WET\",\r\n\t\"Zulu\",\r\n\t\"ROC\",\r\n\t\"ROK\",\r\n\t\"NZ\",\r\n\t\"PRC\",\r\n\t\"PST8PDT\",\r\n\t\"MST7MDT\",\r\n\t\"MST\",\r\n\t\"MET\",\r\n\t\"GMT+0\",\r\n\t\"GMT-0\",\r\n\t\"GMT\",\r\n\t\"GB-Eire\",\r\n\t\"GB\",\r\n\t\"CST6CDT\",\r\n\t\"CST\",\r\n];\r\n\r\n// Google Analytics initialization\r\nReactGA.initialize(\"UA-202653905-1\");\r\nReactGA.pageview(window.location.pathname + window.location.search);\r\n\r\nfunction App() {\r\n\tconst [theme, setTheme] = useState(\"light\");\r\n\tconst [zones, setZones] = useState([]);\r\n\tconst [noZones, setNoZones] = useState(true);\r\n\r\n\tconst [mainTime, setMainTime] = useState(\"\");\r\n\tconst [mainTZ, setMainTZ] = useState(\"Australia/Brisbane\");\r\n\tconst [location, setLocation] = useState(\"Brisbane, Australia\");\r\n\r\n\tconst mainProcess = useCallback(() => {\r\n\t\tfindZones().then((data) => {\r\n\t\t\t// Sort in ascending order\r\n\t\t\tif (data.length === 0) {\r\n\t\t\t\tsetNoZones(true);\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tsetNoZones(false);\r\n\t\t\t}\r\n\r\n\t\t\tdata.sort((a, b) => {\r\n\t\t\t\tvar aTime = moment(Date.now()).tz(a);\r\n\t\t\t\tvar bTime = moment(Date.now()).tz(b);\r\n\t\t\t\treturn (\r\n\t\t\t\t\taTime.hours() * 3600 +\r\n\t\t\t\t\taTime.minutes() * 60 +\r\n\t\t\t\t\taTime.seconds() -\r\n\t\t\t\t\t(bTime.hours() * 3600 +\r\n\t\t\t\t\t\tbTime.minutes() * 60 +\r\n\t\t\t\t\t\tbTime.seconds())\r\n\t\t\t\t);\r\n\t\t\t});\r\n\r\n\t\t\tsetMainTZ(data[0]);\r\n\t\t\tvar curTime = moment.utc(new Date(Date.now())).tz(data[0]);\r\n\t\t\tif (curTime) {\r\n\t\t\t\tsetMainTime(curTime.format(\"h:mm a\"));\r\n\t\t\t} else {\r\n\t\t\t\tsetMainTime(\"00:00 pm\");\r\n\t\t\t}\r\n\r\n\t\t\t// Format as State, Country\r\n\t\t\tvar l = data[0].split(\"/\");\r\n\r\n\t\t\tsetLocation(`${l[1]}, ${l[0]}`);\r\n\t\t\tsetZones([...data.slice(1, 6)]);\r\n\t\t});\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tdocument.documentElement.setAttribute(\r\n\t\t\t\"data-theme\",\r\n\t\t\tlocalStorage.getItem(\"theme\") || \"light\"\r\n\t\t);\r\n\t\tsetTheme(localStorage.getItem(\"theme\") || \"light\");\r\n\r\n\t\tmainProcess();\r\n\r\n\t\t// Update the clock every 10 seconds\r\n\t\tfunction updateTime() {\r\n\t\t\tvar newTime = moment.utc(new Date(Date.now())).tz(mainTZ);\r\n\t\t\tif (newTime) setMainTime(newTime.format(\"hh:mm a\" || \"00:00 pm\"));\r\n\t\t}\r\n\r\n\t\tsetInterval(updateTime, 1000 * 10);\r\n\r\n\t\t// Get a new array every 30mins.\r\n\t\tsetInterval(mainProcess, 1000 * 1800);\r\n\t}, [mainTZ, mainProcess]);\r\n\r\n\t// Finds all zones past 5pm\r\n\tfunction findZones() {\r\n\t\treturn new Promise((resolve) => {\r\n\t\t\t// Find what offset we would need to get to 5pm in any timezone\r\n\t\t\tvar tempZones = [];\r\n\t\t\tvar i = 0;\r\n\r\n\t\t\tmoment.tz.names().forEach((tz) => {\r\n\t\t\t\ti++;\r\n\t\t\t\tvar tzHours = moment.tz(tz).hours();\r\n\t\t\t\tif (tzHours >= 17) {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!excludeTZ.includes(tz) &&\r\n\t\t\t\t\t\t!tz.includes(\"Etc\") &&\r\n\t\t\t\t\t\t!tz.includes(\"GMT+\") &&\r\n\t\t\t\t\t\t!tz.includes(\"GMT-\")\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\ttempZones.push(tz);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (i === moment.tz.names().length) {\r\n\t\t\t\t\treturn resolve(tempZones);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tfunction switchTheme() {\r\n\t\tdocument.documentElement.classList.add(\"theme-changing\");\r\n\t\tif (theme === \"dark\") {\r\n\t\t\tdocument.documentElement.setAttribute(\"data-theme\", \"light\");\r\n\t\t\tsetTheme(\"light\");\r\n\t\t\tlocalStorage.setItem(\"theme\", \"light\");\r\n\t\t\tReactGA.event({\r\n\t\t\t\tcategory: \"User\",\r\n\t\t\t\taction: \"Set Theme: Light\",\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tdocument.documentElement.setAttribute(\"data-theme\", \"dark\");\r\n\t\t\tsetTheme(\"dark\");\r\n\t\t\tlocalStorage.setItem(\"theme\", \"dark\");\r\n\t\t\tReactGA.event({\r\n\t\t\t\tcategory: \"User\",\r\n\t\t\t\taction: \"Set Theme: Dark\",\r\n\t\t\t});\r\n\t\t}\r\n\t\twindow.setTimeout(function () {\r\n\t\t\tdocument.documentElement.classList.remove(\"theme-changing\");\r\n\t\t}, 1000);\r\n\t}\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t{!noZones ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\tIt's 5pm somewhere in the world!\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\tIt is currently{\" \"}\r\n\t\t\t\t\t\t\t{mainTime} in:\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t

{location.replace(\"_\", \" \")}

\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t{zones.map((zone) => {\r\n\t\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t
\r\n\t\t\t\t) : (\r\n\t\t\t\t\t

\r\n\t\t\t\t\t\tOh No, there are currently no timezones after 5pm and\r\n\t\t\t\t\t\tbefore 7pm. Please allow some time and we will continue\r\n\t\t\t\t\t\tsearching in the background.\r\n\t\t\t\t\t

\r\n\t\t\t\t)}\r\n\t\t\t
\r\n\t\t\t{theme === \"light\" ? (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t© Michael {moment(Date.now()).year()}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default App;\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport App from './App.jsx';\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);"],"sourceRoot":""}