{"action":"created","issue":{"url":"https://api.github.com/repos/lmaccherone/tzTime/issues/3","repository_url":"https://api.github.com/repos/lmaccherone/tzTime","labels_url":"https://api.github.com/repos/lmaccherone/tzTime/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/lmaccherone/tzTime/issues/3/comments","events_url":"https://api.github.com/repos/lmaccherone/tzTime/issues/3/events","html_url":"https://github.com/lmaccherone/tzTime/issues/3","id":167808562,"number":3,"title":"tzTime crashes on loading timezone in Meteor","user":{"login":"craigdrayton","id":1066478,"avatar_url":"https://avatars.githubusercontent.com/u/1066478?v=3","gravatar_id":"","url":"https://api.github.com/users/craigdrayton","html_url":"https://github.com/craigdrayton","followers_url":"https://api.github.com/users/craigdrayton/followers","following_url":"https://api.github.com/users/craigdrayton/following{/other_user}","gists_url":"https://api.github.com/users/craigdrayton/gists{/gist_id}","starred_url":"https://api.github.com/users/craigdrayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigdrayton/subscriptions","organizations_url":"https://api.github.com/users/craigdrayton/orgs","repos_url":"https://api.github.com/users/craigdrayton/repos","events_url":"https://api.github.com/users/craigdrayton/events{/privacy}","received_events_url":"https://api.github.com/users/craigdrayton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-27T09:20:27Z","updated_at":"2016-08-27T08:38:31Z","closed_at":null,"body":"I've been unable to get Lumenize and tzTime working on my Meteor 1.3 project running in WebStorm IDE.\r\n\r\nIn following the Lumenize documentation for TimeSeries calculator, I found using .getISOStringInTZ() to crash Meteor if given a timezone string. I believe tzTime is failing to load the timezone files. When I execute the following code on the server it works as expected:\r\n\r\n  ```\r\nvar tzTime = require('tzTime');\r\n  console.log(new tzTime.Time('2010-01-02'));\r\n// Works fine, returns time object\r\n\r\n  console.log(new tzTime.Time('2011-01-02').getISOStringInTZ('GMT'));\r\n// Works fine, returns 2011-01-02T00:00:00.000Z\r\n\r\n  console.log(new tzTime.Time('2011-01-02').getISOStringInTZ('INVALID STRING'));\r\n// As expected, get 'Error: Timezone \"INVALID STRING\" is either incorrect, or not loaded in the timezone registry at invalidTZError ... /node_modules/tztime/lib/timezone-js.js:43:11\r\n```\r\n\r\nBut when I execute the following on the server, it crashes Meteor:\r\n\r\n```\r\n  console.log(new tzTime.Time('2011-01-02').getISOStringInTZ('Australia/Melbourne'));\r\n\r\nTypeError: Cannot read property '5' of undefined\r\nat convertRuleToExactDateAndTime (/Users/craigdrayton/WebstormProjects/dataSandpit/node_modules/tztime/lib/timezone-js.js:246:38)\r\n at compareDates (/Users/craigdrayton/WebstormProjects/dataSandpit/node_modules/tztime/lib/timezone-js.js:327:13)\r\nat Array.sort (native)\r\nat Array.sort (/Users/craigdrayton/.meteor/packages/es5-shim/.4.5.13.c4kkxr++os+web.browser+web.cordova/npm/node_modules/es5-shim/es5-shim.js:950:16)\r\nat getRule (/Users/craigdrayton/WebstormProjects/dataSandpit/node_modules/tztime/lib/timezone-js.js:348:21)\r\nat [object Object].getTzInfo (/Users/craigdrayton/WebstormProjects/dataSandpit/node_modules/tztime/lib/timezone-js.js:593:16)\r\nat Time.getJSDate (/Users/craigdrayton/WebstormProjects/dataSandpit/node_modules/tztime/src/Time.js:693:36)\r\nat Time.getISOStringInTZ (/Users/craigdrayton/WebstormProjects/dataSandpit/node_modules/tztime/src/Time.js:711:21)\r\nat server/main.js:14:45\r\nat /Users/craigdrayton/WebstormProjects/dataSandpit/.meteor/local/build/programs/server/boot.js:304:5\r\n\r\n```\r\n\r\nI can't work out what's going on and would love some help! Thanks."},"comment":{"url":"https://api.github.com/repos/lmaccherone/tzTime/issues/comments/242904960","html_url":"https://github.com/lmaccherone/tzTime/issues/3#issuecomment-242904960","issue_url":"https://api.github.com/repos/lmaccherone/tzTime/issues/3","id":242904960,"user":{"login":"craigdrayton","id":1066478,"avatar_url":"https://avatars.githubusercontent.com/u/1066478?v=3","gravatar_id":"","url":"https://api.github.com/users/craigdrayton","html_url":"https://github.com/craigdrayton","followers_url":"https://api.github.com/users/craigdrayton/followers","following_url":"https://api.github.com/users/craigdrayton/following{/other_user}","gists_url":"https://api.github.com/users/craigdrayton/gists{/gist_id}","starred_url":"https://api.github.com/users/craigdrayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigdrayton/subscriptions","organizations_url":"https://api.github.com/users/craigdrayton/orgs","repos_url":"https://api.github.com/users/craigdrayton/repos","events_url":"https://api.github.com/users/craigdrayton/events{/privacy}","received_events_url":"https://api.github.com/users/craigdrayton/received_events","type":"User","site_admin":false},"created_at":"2016-08-27T08:38:31Z","updated_at":"2016-08-27T08:38:31Z","body":"Hi Larry, hope you're having a good weekend. Have you been able to take a look at this by any chance?"}}
{"actor":{"display_login":"craigdrayton"}}