{"action":"created","issue":{"url":"https://api.github.com/repos/zendesk/biz/issues/35","labels_url":"https://api.github.com/repos/zendesk/biz/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/biz/issues/35/comments","events_url":"https://api.github.com/repos/zendesk/biz/issues/35/events","html_url":"https://github.com/zendesk/biz/pull/35","id":111997291,"number":35,"title":"ZD#1290963 clamp DayTime values","user":{"login":"jcheatham","id":1170999,"avatar_url":"https://avatars.githubusercontent.com/u/1170999?v=3","gravatar_id":"","url":"https://api.github.com/users/jcheatham","html_url":"https://github.com/jcheatham","followers_url":"https://api.github.com/users/jcheatham/followers","following_url":"https://api.github.com/users/jcheatham/following{/other_user}","gists_url":"https://api.github.com/users/jcheatham/gists{/gist_id}","starred_url":"https://api.github.com/users/jcheatham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcheatham/subscriptions","organizations_url":"https://api.github.com/users/jcheatham/orgs","repos_url":"https://api.github.com/users/jcheatham/repos","events_url":"https://api.github.com/users/jcheatham/events{/privacy}","received_events_url":"https://api.github.com/users/jcheatham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-18T02:52:12Z","updated_at":"2015-10-18T03:06:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zendesk/biz/pulls/35","html_url":"https://github.com/zendesk/biz/pull/35","diff_url":"https://github.com/zendesk/biz/pull/35.diff","patch_url":"https://github.com/zendesk/biz/pull/35.patch"},"body":"@hsume2 @gautamprabhu @craiglittle @pdeuter \r\n\r\n### Risks\r\nLow - clamps values that are outside of time argument range"},"comment":{"url":"https://api.github.com/repos/zendesk/biz/issues/comments/148973062","html_url":"https://github.com/zendesk/biz/pull/35#issuecomment-148973062","issue_url":"https://api.github.com/repos/zendesk/biz/issues/35","id":148973062,"user":{"login":"hsume2","id":62437,"avatar_url":"https://avatars.githubusercontent.com/u/62437?v=3","gravatar_id":"","url":"https://api.github.com/users/hsume2","html_url":"https://github.com/hsume2","followers_url":"https://api.github.com/users/hsume2/followers","following_url":"https://api.github.com/users/hsume2/following{/other_user}","gists_url":"https://api.github.com/users/hsume2/gists{/gist_id}","starred_url":"https://api.github.com/users/hsume2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsume2/subscriptions","organizations_url":"https://api.github.com/users/hsume2/orgs","repos_url":"https://api.github.com/users/hsume2/repos","events_url":"https://api.github.com/users/hsume2/events{/privacy}","received_events_url":"https://api.github.com/users/hsume2/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T03:06:05Z","updated_at":"2015-10-18T03:06:05Z","body":"@jcheatham it's exactly `2015-10-17 24:00:00 UTC` that can't be converted to `America/Sao_Paulo` time. So adding an hour and clamping back down to `86_400` is going to invoke [this code](https://github.com/zendesk/biz/blob/master/lib/biz/time.rb#L42) with the same `day_time`, causing an infinite loop.\r\n\r\nIf you add this spec you'll see:\r\n\r\n```diff\r\ndiff --git a/spec/schedule_spec.rb b/spec/schedule_spec.rb\r\nindex 8fecd60..75d3576 100644\r\n--- a/spec/schedule_spec.rb\r\n+++ b/spec/schedule_spec.rb\r\n@@ -76,6 +76,24 @@ RSpec.describe Biz::Schedule do\r\n     end\r\n   end\r\n\r\n+  describe 'ZD#1290963' do\r\n+    let(:hours) {\r\n+      {\r\n+        sun: {'00:00' => '24:00'},\r\n+        mon: {'00:00' => '24:00'},\r\n+        tue: {'00:00' => '24:00'},\r\n+        wed: {'00:00' => '24:00'},\r\n+        thu: {'00:00' => '24:00'},\r\n+        fri: {'00:00' => '24:00'},\r\n+        sat: {'00:00' => '24:00'}\r\n+      }\r\n+    }\r\n+    let(:time_zone) { 'America/Sao_Paulo' }\r\n+    it 'should be ok' do\r\n+      schedule.within(Time.parse('2015-02-03 16:10:25 UTC'), Time.now.utc)\r\n+    end\r\n+  end\r\n+\r\n   describe '#in_hours?' do\r\n     context 'when the time is not in business hours' do\r\n       let(:time) { Time.utc(2006, 1, 2, 8) }\r\n```"}}