{"action":"closed","issue":{"url":"https://api.github.com/repos/chmln/flatpickr/issues/379","repository_url":"https://api.github.com/repos/chmln/flatpickr","labels_url":"https://api.github.com/repos/chmln/flatpickr/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/chmln/flatpickr/issues/379/comments","events_url":"https://api.github.com/repos/chmln/flatpickr/issues/379/events","html_url":"https://github.com/chmln/flatpickr/issues/379","id":187412652,"number":379,"title":"Toggling AM/PM when the time is 12:00 AM has no effect","user":{"login":"christophersansone","id":686233,"avatar_url":"https://avatars.githubusercontent.com/u/686233?v=3","gravatar_id":"","url":"https://api.github.com/users/christophersansone","html_url":"https://github.com/christophersansone","followers_url":"https://api.github.com/users/christophersansone/followers","following_url":"https://api.github.com/users/christophersansone/following{/other_user}","gists_url":"https://api.github.com/users/christophersansone/gists{/gist_id}","starred_url":"https://api.github.com/users/christophersansone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophersansone/subscriptions","organizations_url":"https://api.github.com/users/christophersansone/orgs","repos_url":"https://api.github.com/users/christophersansone/repos","events_url":"https://api.github.com/users/christophersansone/events{/privacy}","received_events_url":"https://api.github.com/users/christophersansone/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-04T18:57:49Z","updated_at":"2016-11-04T19:56:27Z","closed_at":"2016-11-04T19:56:27Z","body":"In the time picker, if the time is 12:00 AM, clicking on the AM/PM toggle does not change the time.  The problem seems due to https://github.com/chmln/flatpickr/commit/0943bd80a31a9390befb4c7c71b1eef6614e9927  here:\r\n\r\n```javascript\r\nlet hours = (parseInt(self.hourElement.value, 10) || 0) + 12 * (!self.config.time_24hr && self.amPM.innerHTML === \"PM\")\r\n```\r\n\r\nIf `hourElement` has a value of 12, and `amPM` has a value of `PM`, then `hours` will equal 24.  This winds up setting it back to 12am, thus having no effect.  Also, from my understanding of this line, it seems like 12am would set hours to 12, which would be 12pm.  \r\n\r\nPR is on its way."}}
{"actor":{"display_login":"chmln"}}