{"action":"created","issue":{"url":"https://api.github.com/repos/jakubroztocil/rrule/issues/97","labels_url":"https://api.github.com/repos/jakubroztocil/rrule/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/jakubroztocil/rrule/issues/97/comments","events_url":"https://api.github.com/repos/jakubroztocil/rrule/issues/97/events","html_url":"https://github.com/jakubroztocil/rrule/pull/97","id":72756983,"number":97,"title":"Time Zone Support","user":{"login":"aramk","id":574282,"avatar_url":"https://avatars.githubusercontent.com/u/574282?v=3","gravatar_id":"","url":"https://api.github.com/users/aramk","html_url":"https://github.com/aramk","followers_url":"https://api.github.com/users/aramk/followers","following_url":"https://api.github.com/users/aramk/following{/other_user}","gists_url":"https://api.github.com/users/aramk/gists{/gist_id}","starred_url":"https://api.github.com/users/aramk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aramk/subscriptions","organizations_url":"https://api.github.com/users/aramk/orgs","repos_url":"https://api.github.com/users/aramk/repos","events_url":"https://api.github.com/users/aramk/events{/privacy}","received_events_url":"https://api.github.com/users/aramk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-03T06:20:00Z","updated_at":"2015-06-06T01:45:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jakubroztocil/rrule/pulls/97","html_url":"https://github.com/jakubroztocil/rrule/pull/97","diff_url":"https://github.com/jakubroztocil/rrule/pull/97.diff","patch_url":"https://github.com/jakubroztocil/rrule/pull/97.patch"},"body":"This uses some of the methods in #78 and is an implementation of what was discussed in #38.\r\n\r\nI've created a separate library at [tz-date](https://github.com/aramk/tz-date) which contains a `TimeZoneDate` that extends `Date`, adheres to its API, has Mocha tests, and supports time zones through http://momentjs.com/timezone. This is in CoffeeScript so you'll need to run `bower install` in rrule and then `grunt build` in `bower_components/tz-date` to generate the JavaScript used by the tests I've added.\r\n\r\nSince Date doesn't support having a time zone as the last argument and returns Invalid Date, I've\r\ncreated a new method called `createDate()` to handle this situation. All date creation in the\r\nlibrary is now handled through this method. This also adds a \"timezone\" option which is passed to\r\nall calls of `createDate()`.\r\n\r\nAs for the testing, tests/index.html will still work as before and use Date. In tests/timezone.html\r\nI add TimeZoneDate and its dependency libraries, and in timezone-tests I set TimeZoneDate as the\r\ncustom Date class to use. Here I've tests two time zones - my home city of Melbourne and\r\nLos Angeles. TimeZoneDate has its own Mocha [tests](https://github.com/aramk/tz-date/blob/master/test/TimeZoneDateSpec.coffee) to ensure the getters and setters behave correctly.\r\nFor maximum coverage I've also ensured the existing tests are run with TimeZoneDate, so I'm fairly\r\nconvinced it's working well :)\r\n\r\nOne thing we might want to standardise is whether to use `timeZone` or `timezone`. I've been using\r\nthe \"time zone\" convention on the Wikipedia page, but \"timezone\" is fairly common elsewhere,\r\nespecially in libraries, and moment-timezone's docs use it interchangeably... Not sure which is\r\n\"correct\", but standardising will reduce the confusion.\r\n\r\nI hope this can be merged since it adds a vital feature which is missing from this library and which\r\nlikely impacts many people who are building apps and deploying them across the world. If not, this\r\nbranch is here for everyone to use."},"comment":{"url":"https://api.github.com/repos/jakubroztocil/rrule/issues/comments/109498295","html_url":"https://github.com/jakubroztocil/rrule/pull/97#issuecomment-109498295","issue_url":"https://api.github.com/repos/jakubroztocil/rrule/issues/97","id":109498295,"user":{"login":"aramk","id":574282,"avatar_url":"https://avatars.githubusercontent.com/u/574282?v=3","gravatar_id":"","url":"https://api.github.com/users/aramk","html_url":"https://github.com/aramk","followers_url":"https://api.github.com/users/aramk/followers","following_url":"https://api.github.com/users/aramk/following{/other_user}","gists_url":"https://api.github.com/users/aramk/gists{/gist_id}","starred_url":"https://api.github.com/users/aramk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aramk/subscriptions","organizations_url":"https://api.github.com/users/aramk/orgs","repos_url":"https://api.github.com/users/aramk/repos","events_url":"https://api.github.com/users/aramk/events{/privacy}","received_events_url":"https://api.github.com/users/aramk/received_events","type":"User","site_admin":false},"created_at":"2015-06-06T01:45:06Z","updated_at":"2015-06-06T01:45:06Z","body":"I've been using this in production and it's been working fine. I've added tests, it's just a question of whether this is eventually merged in or not."}}