{"action":"created","issue":{"url":"https://api.github.com/repos/LGoodDatePicker/LGoodDatePicker/issues/17","repository_url":"https://api.github.com/repos/LGoodDatePicker/LGoodDatePicker","labels_url":"https://api.github.com/repos/LGoodDatePicker/LGoodDatePicker/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/LGoodDatePicker/LGoodDatePicker/issues/17/comments","events_url":"https://api.github.com/repos/LGoodDatePicker/LGoodDatePicker/issues/17/events","html_url":"https://github.com/LGoodDatePicker/LGoodDatePicker/issues/17","id":153721044,"number":17,"title":"Bug report: Exception when setting a veto policy in a CalendarPanel.","user":{"login":"willsuh","id":19261693,"avatar_url":"https://avatars.githubusercontent.com/u/19261693?v=3","gravatar_id":"","url":"https://api.github.com/users/willsuh","html_url":"https://github.com/willsuh","followers_url":"https://api.github.com/users/willsuh/followers","following_url":"https://api.github.com/users/willsuh/following{/other_user}","gists_url":"https://api.github.com/users/willsuh/gists{/gist_id}","starred_url":"https://api.github.com/users/willsuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willsuh/subscriptions","organizations_url":"https://api.github.com/users/willsuh/orgs","repos_url":"https://api.github.com/users/willsuh/repos","events_url":"https://api.github.com/users/willsuh/events{/privacy}","received_events_url":"https://api.github.com/users/willsuh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-09T07:52:18Z","updated_at":"2016-05-10T16:44:45Z","closed_at":"2016-05-10T00:29:42Z","body":"Hello,\r\n\r\nI am using the latest version LGoodDatePicker 5.4.2.\r\nI believe there is bug when setting veto policy for CalendarPanel.\r\nThe order is:\r\n1. define DatePickerSettings;\r\n2. define CalendarPanel with DatePickerSettings as input;\r\n3. setVetoPolicy to the previously defined DatePickerSettings.\r\n\r\nError occurs:\r\njava.lang.RuntimeException: DatePickerSettings.setVetoPolicy(), A veto policy can only be set after constructing the DatePicker.\r\nat com.github.lgooddatepicker.datepicker.DatePickerSettings.setVetoPolicy(DatePickerSettings.java:845)\r\n\r\nThis error does not occur with DatePicker component.\r\n\r\nMy code:\r\nDatePickerSettings settings = new DatePickerSettings();\r\nsettings.firstDayOfWeek = DayOfWeek.MONDAY;\r\nsettings.setAllowEmptyDates(false);\r\nsettings.highlightPolicy = new HighlightPeriod();\r\nCalendarPanel customizedDatePicker = new CalendarPanel(settings);\r\nsettings.setVetoPolicy(new vetoPolicy());\r\ncustomizedDatePicker.addCalendarSelectionListener(this);\r\n\r\nOne way to lure the procedure is the create an unused DatePicker (new DatePicker(settings)), just after defining the CalendarPanel.\r\n\r\nThank you to check this issue.\r\nGuillaume"},"comment":{"url":"https://api.github.com/repos/LGoodDatePicker/LGoodDatePicker/issues/comments/218218079","html_url":"https://github.com/LGoodDatePicker/LGoodDatePicker/issues/17#issuecomment-218218079","issue_url":"https://api.github.com/repos/LGoodDatePicker/LGoodDatePicker/issues/17","id":218218079,"user":{"login":"BlakeTNC","id":5067548,"avatar_url":"https://avatars.githubusercontent.com/u/5067548?v=3","gravatar_id":"","url":"https://api.github.com/users/BlakeTNC","html_url":"https://github.com/BlakeTNC","followers_url":"https://api.github.com/users/BlakeTNC/followers","following_url":"https://api.github.com/users/BlakeTNC/following{/other_user}","gists_url":"https://api.github.com/users/BlakeTNC/gists{/gist_id}","starred_url":"https://api.github.com/users/BlakeTNC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlakeTNC/subscriptions","organizations_url":"https://api.github.com/users/BlakeTNC/orgs","repos_url":"https://api.github.com/users/BlakeTNC/repos","events_url":"https://api.github.com/users/BlakeTNC/events{/privacy}","received_events_url":"https://api.github.com/users/BlakeTNC/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T16:44:45Z","updated_at":"2016-05-10T16:44:45Z","body":"To clarify: When you mentioned \"setting the locale\", are you talking about setting the locale after constructing the DatePickerSettings? You can currently change the locale when the settings are created (in the DatePickerSettings constructor). But it's a one-time thing at the moment, mostly because so many other settings would need to be changed any time the locale changed.\r\n\r\nWarm regards,\r\nBlake"}}