svbeon
7/11/2016 - 2:59 PM

wa0x6e/cal-heatmap arbitrary timezone parser

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;
}