{"action":"opened","issue":{"url":"https://api.github.com/repos/xdan/periodpicker/issues/46","repository_url":"https://api.github.com/repos/xdan/periodpicker","labels_url":"https://api.github.com/repos/xdan/periodpicker/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/xdan/periodpicker/issues/46/comments","events_url":"https://api.github.com/repos/xdan/periodpicker/issues/46/events","html_url":"https://github.com/xdan/periodpicker/issues/46","id":176456390,"number":46,"title":"Selecting a whole week","user":{"login":"grzegorztomasiak","id":5319920,"avatar_url":"https://avatars.githubusercontent.com/u/5319920?v=3","gravatar_id":"","url":"https://api.github.com/users/grzegorztomasiak","html_url":"https://github.com/grzegorztomasiak","followers_url":"https://api.github.com/users/grzegorztomasiak/followers","following_url":"https://api.github.com/users/grzegorztomasiak/following{/other_user}","gists_url":"https://api.github.com/users/grzegorztomasiak/gists{/gist_id}","starred_url":"https://api.github.com/users/grzegorztomasiak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grzegorztomasiak/subscriptions","organizations_url":"https://api.github.com/users/grzegorztomasiak/orgs","repos_url":"https://api.github.com/users/grzegorztomasiak/repos","events_url":"https://api.github.com/users/grzegorztomasiak/events{/privacy}","received_events_url":"https://api.github.com/users/grzegorztomasiak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-12T19:00:38Z","updated_at":"2016-09-12T19:00:38Z","closed_at":null,"body":"I have sort of manage to select whole week like that (written in coffeescript):\r\n\r\n```\r\n$(_element).on 'change', ()->\r\n        picker = $(this).data('periodpicker')\r\n        selectedDate = picker.period[0];\r\n        picker.period = [moment(selectedDate).startOf('isoWeek').toDate(), moment(selectedDate).endOf('isoWeek').toDate()]\r\n        picker.applyOptions()\r\n        picker.regenerate()\r\n```\r\n\r\nbut does select but it also throws an error:\r\n\r\n`TypeError: b.period[0].format is not a function`\r\n\r\nHow can I fix that error?"}}
{"actor":{"display_login":"grzegorztomasiak"}}