Created
July 11, 2016 14:59
-
-
Save swantzter/5715db84eba0df8a5a76989fad6c1d5b to your computer and use it in GitHub Desktop.
wa0x6e/cal-heatmap arbitrary timezone parser
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
/* | |
* Released uder the MIT Licence | |
* Copyright (c) 2016 Svante Bengtson | |
*/ | |
function parser(data) { | |
var keys = Object.keys(data); | |
var parsed = {}; | |
for(key in keys) { | |
newKey = parseInt(keys[key]) + parseInt((new Date( keys[key] * 1000 )).getTimezoneOffset() * 60); | |
parsed[newKey] = data[keys[key]]; | |
} | |
return parsed; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment