Skip to content

Instantly share code, notes, and snippets.

@swantzter
Created July 11, 2016 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swantzter/5715db84eba0df8a5a76989fad6c1d5b to your computer and use it in GitHub Desktop.
Save swantzter/5715db84eba0df8a5a76989fad6c1d5b to your computer and use it in GitHub Desktop.
wa0x6e/cal-heatmap arbitrary timezone parser
/*
* 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