{"action":"closed","issue":{"url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1561","repository_url":"https://api.github.com/repos/eternicode/bootstrap-datepicker","labels_url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1561/labels{/name}","comments_url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1561/comments","events_url":"https://api.github.com/repos/eternicode/bootstrap-datepicker/issues/1561/events","html_url":"https://github.com/eternicode/bootstrap-datepicker/issues/1561","id":105019095,"number":1561,"title":"Change event triggered on initialization","user":{"login":"sladkoff","id":6025787,"avatar_url":"https://avatars.githubusercontent.com/u/6025787?v=3","gravatar_id":"","url":"https://api.github.com/users/sladkoff","html_url":"https://github.com/sladkoff","followers_url":"https://api.github.com/users/sladkoff/followers","following_url":"https://api.github.com/users/sladkoff/following{/other_user}","gists_url":"https://api.github.com/users/sladkoff/gists{/gist_id}","starred_url":"https://api.github.com/users/sladkoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sladkoff/subscriptions","organizations_url":"https://api.github.com/users/sladkoff/orgs","repos_url":"https://api.github.com/users/sladkoff/repos","events_url":"https://api.github.com/users/sladkoff/events{/privacy}","received_events_url":"https://api.github.com/users/sladkoff/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-05T10:28:08Z","updated_at":"2016-06-13T09:51:45Z","closed_at":"2016-06-13T09:51:45Z","body":"Hello,\r\n\r\nEDIT: So I just found [#1512](https://github.com/eternicode/bootstrap-datepicker/issues/1512) for which this is almost a duplicate. That thread is about the ``changeDate`` event though, so I decided to post anyway. I'll let the contributors decide what to do with this issue.\r\n\r\nI have a *suggestion* regarding the datepicker after upgrading from version 1.4 to 1.5.\r\n\r\nI have noticed that the datepicker triggers a change event on the input at initialization.\r\n\r\nThis is a problem for us because we have change event listeners on all inputs of our form. Of course, we only want to handle user-made events. ~~We were able to work around it since all our datepickers have a special class, so that we now only listen for the plugin's ``changeDate`` event on those elements.~~ This does not really fix it, since the ``changeDate`` event is also triggered on init, but only when the original input already has a value assigned (see linked issue in EDIT on top).\r\n\r\nI traced the event and found out that it's most likely related to [line 803](https://github.com/eternicode/bootstrap-datepicker/blob/master/dist/js/bootstrap-datepicker.js#L801) which was not there in v1.4. \r\n\r\nI'm not familiar with your codebase but as far as I understood, the plugins' internal ``update`` function is called when the datepicker is first initialized. \r\nThis does not look like a bug but I think that the behavior could be optimized - it would be more intuitive and standardized to be able to listen for the common ``change`` event and I don't think it's good to trigger the ``change`` on init, since there was in fact no change.\r\n\r\nCan anyone relate?\r\n\r\nPS. I'll post a fiddle when I have the time, if necessary.\r\n"}}
{"actor":{"display_login":"acrobat"}}