{"action":"opened","issue":{"url":"https://api.github.com/repos/Dogfalo/materialize/issues/6040","repository_url":"https://api.github.com/repos/Dogfalo/materialize","labels_url":"https://api.github.com/repos/Dogfalo/materialize/issues/6040/labels{/name}","comments_url":"https://api.github.com/repos/Dogfalo/materialize/issues/6040/comments","events_url":"https://api.github.com/repos/Dogfalo/materialize/issues/6040/events","html_url":"https://github.com/Dogfalo/materialize/issues/6040","id":343046360,"node_id":"MDU6SXNzdWUzNDMwNDYzNjA=","number":6040,"title":"Date picker doesn't take options if called with `M.Datepicker.init`","user":{"login":"optyler","id":10259,"node_id":"MDQ6VXNlcjEwMjU5","avatar_url":"https://avatars2.githubusercontent.com/u/10259?v=4","gravatar_id":"","url":"https://api.github.com/users/optyler","html_url":"https://github.com/optyler","followers_url":"https://api.github.com/users/optyler/followers","following_url":"https://api.github.com/users/optyler/following{/other_user}","gists_url":"https://api.github.com/users/optyler/gists{/gist_id}","starred_url":"https://api.github.com/users/optyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optyler/subscriptions","organizations_url":"https://api.github.com/users/optyler/orgs","repos_url":"https://api.github.com/users/optyler/repos","events_url":"https://api.github.com/users/optyler/events{/privacy}","received_events_url":"https://api.github.com/users/optyler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-20T09:57:35Z","updated_at":"2018-07-20T09:57:35Z","closed_at":null,"author_association":"NONE","body":"When you try to init the date picker programmatically, you should use the jQuery version. Vanilla one does not take care of options.\r\n\r\n```js\r\nconst options = {\r\n  autoClose : true,\r\n};\r\n\r\n// BROKEN: date picker correctly bind, BUT options are not take\r\ndocument.addEventListener('DOMContentLoaded', function() {\r\n  const elems = document.querySelectorAll('.datepicker');\r\n  const instances = M.Datepicker.init(elems, options);\r\n});\r\n\r\n// WORKING : date picker correctly bind, AND options are correctly take\r\n$(document).ready(function(){\r\n  $('.datepicker').datepicker(options);\r\n});\r\n```\r\n\r\n* Version used: 1.0.0.rc2\r\n* Browser Name and version: latest Chrome\r\n* Operating System and version (desktop or mobile): osx, ubuntu, windows\r\n"}}
{"actor":{"display_login":"optyler"}}