{"action":"created","issue":{"url":"https://api.github.com/repos/icambron/twix.js/issues/66","labels_url":"https://api.github.com/repos/icambron/twix.js/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/icambron/twix.js/issues/66/comments","events_url":"https://api.github.com/repos/icambron/twix.js/issues/66/events","html_url":"https://github.com/icambron/twix.js/pull/66","id":69060851,"number":66,"title":"Add support for half-open ranges","user":{"login":"butterflyhug","id":282994,"avatar_url":"https://avatars.githubusercontent.com/u/282994?v=3","gravatar_id":"","url":"https://api.github.com/users/butterflyhug","html_url":"https://github.com/butterflyhug","followers_url":"https://api.github.com/users/butterflyhug/followers","following_url":"https://api.github.com/users/butterflyhug/following{/other_user}","gists_url":"https://api.github.com/users/butterflyhug/gists{/gist_id}","starred_url":"https://api.github.com/users/butterflyhug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butterflyhug/subscriptions","organizations_url":"https://api.github.com/users/butterflyhug/orgs","repos_url":"https://api.github.com/users/butterflyhug/repos","events_url":"https://api.github.com/users/butterflyhug/events{/privacy}","received_events_url":"https://api.github.com/users/butterflyhug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-17T04:31:58Z","updated_at":"2015-04-17T05:13:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/icambron/twix.js/pulls/66","html_url":"https://github.com/icambron/twix.js/pull/66","diff_url":"https://github.com/icambron/twix.js/pull/66.diff","patch_url":"https://github.com/icambron/twix.js/pull/66.patch"},"body":"@icambron  I'm opening this as a very minimal PR because I'd like your feedback on the implementation approach.  If you like what you see here, I'll work on updating the docs and adding some simple tests.\r\n\r\nI've added support for an \"containEndpoints\" configuration option when constructing a new Twix range.  There are four valid values for the containEndpoints option:\r\n\r\n- `true`:  construct a fully closed range, where the range contains both its start and end moments\r\n- `\"end\"`:  construct a half open range, where the range contains its end but not its start moment\r\n- `\"start\"`:  construct a half open range, where the range contains its start but not its end moment\r\n- `false`:  construct a fully open range that contains neither its start nor end moments\r\n\r\nThis is implemented by twiddling the values of `_trueStart` and `_trueEnd` in Twix's constructor, minimizing the impact on code complexity.  I haven't tested everything comprehensively yet, but based on some informal testing of various API methods, I feel like the resulting behavior matches my expectations quite nicely — formatting functions are generally unaffected, while mathematical functions appear to consistently respect the munged endpoints.\r\n\r\nIt is worth noting that Twix's set algebra functions (e.g. `Twix.intersection`) will currently always act on the `_trueStart` and `_trueEnd` values to create a mathematically-correct closed range, even if one of the source ranges was a half-open or fully open range.  This might be unintuitive for some formatting-centric use cases.\r\n\r\nThe default value of containEndpoints is `true`, for backward compatibility with previous versions of Twix.\r\n\r\nThis PR is largely motivated by our discussion in #44.  Sorry it took me so long to follow up on this!"},"comment":{"url":"https://api.github.com/repos/icambron/twix.js/issues/comments/93894333","html_url":"https://github.com/icambron/twix.js/pull/66#issuecomment-93894333","issue_url":"https://api.github.com/repos/icambron/twix.js/issues/66","id":93894333,"user":{"login":"icambron","id":244988,"avatar_url":"https://avatars.githubusercontent.com/u/244988?v=3","gravatar_id":"","url":"https://api.github.com/users/icambron","html_url":"https://github.com/icambron","followers_url":"https://api.github.com/users/icambron/followers","following_url":"https://api.github.com/users/icambron/following{/other_user}","gists_url":"https://api.github.com/users/icambron/gists{/gist_id}","starred_url":"https://api.github.com/users/icambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icambron/subscriptions","organizations_url":"https://api.github.com/users/icambron/orgs","repos_url":"https://api.github.com/users/icambron/repos","events_url":"https://api.github.com/users/icambron/events{/privacy}","received_events_url":"https://api.github.com/users/icambron/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T05:13:27Z","updated_at":"2015-04-17T05:13:27Z","body":"You guys are here in Cambridge, right? When you get this done I'll buy you and @benesch a beer."}}