{"action":"created","issue":{"url":"https://api.github.com/repos/patchthecode/JTAppleCalendar/issues/410","repository_url":"https://api.github.com/repos/patchthecode/JTAppleCalendar","labels_url":"https://api.github.com/repos/patchthecode/JTAppleCalendar/issues/410/labels{/name}","comments_url":"https://api.github.com/repos/patchthecode/JTAppleCalendar/issues/410/comments","events_url":"https://api.github.com/repos/patchthecode/JTAppleCalendar/issues/410/events","html_url":"https://github.com/patchthecode/JTAppleCalendar/issues/410","id":227906798,"number":410,"title":"ConfigurationParameters.firstDayOfWeek not working when in/out dates are not generated","user":{"login":"popodidi","id":8709463,"avatar_url":"https://avatars1.githubusercontent.com/u/8709463?v=3","gravatar_id":"","url":"https://api.github.com/users/popodidi","html_url":"https://github.com/popodidi","followers_url":"https://api.github.com/users/popodidi/followers","following_url":"https://api.github.com/users/popodidi/following{/other_user}","gists_url":"https://api.github.com/users/popodidi/gists{/gist_id}","starred_url":"https://api.github.com/users/popodidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popodidi/subscriptions","organizations_url":"https://api.github.com/users/popodidi/orgs","repos_url":"https://api.github.com/users/popodidi/repos","events_url":"https://api.github.com/users/popodidi/events{/privacy}","received_events_url":"https://api.github.com/users/popodidi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-11T07:54:09Z","updated_at":"2017-05-11T14:36:45Z","closed_at":null,"body":"Hi,\r\nFirst of all, thanks for this great pod.\r\n\r\nI am in the version 7.0.2 and I have a problem when calendar is in one row mode.\r\nI aim to make an app where users can switch between week/month mode of the calendar. I call `calendarView.reloadData()` when users switch between modes and return different `ConfigurationParameters` for each.\r\nIt seems that the `firstDayOfWeek` parameter I passed when initializing `ConfigurationParameters` is not working.\r\n\r\n```swift\r\n/*\r\n variable I use to store the state of week/month mode\r\n  - true: month mode\r\n  - false: week mode\r\n */\r\nvar calendarIsExpanded: Bool = true\r\n```\r\n\r\nJTAppleCalendarViewDataSource\r\n```swift\r\nfunc configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {\r\n        let startDate = Date()\r\n        let endDate = Date().addingTimeInterval(100000000)\r\n        if !calendarIsExpanded {\r\n            return ConfigurationParameters(startDate: startDate, endDate: endDate, numberOfRows: 1, generateInDates: .off, generateOutDates: .off, firstDayOfWeek: .sunday)\r\n        } else {\r\n            return ConfigurationParameters(startDate: startDate, endDate:\r\n                endDate, numberOfRows: 6, firstDayOfWeek: .sunday)\r\n        }\r\n        \r\n    }\r\n```\r\n\r\nAnd it turns out that when `!calendarIsExpanded`, the `firstDayOfWeek` is always `.monday`.\r\n\r\nIn month mode, it works nicely.\r\n![simulator screen shot 11 may 2017 3 48 40 pm](https://cloud.githubusercontent.com/assets/8709463/25938318/5e993f84-3661-11e7-9f47-f8566b7aec50.png)\r\n\r\nIn week mode, you can see there is one day shift from the previous one\r\n![simulator screen shot 11 may 2017 3 48 31 pm](https://cloud.githubusercontent.com/assets/8709463/25938326/6918c16e-3661-11e7-8ebc-3d9eaecf2e01.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/patchthecode/JTAppleCalendar/issues/comments/300809189","html_url":"https://github.com/patchthecode/JTAppleCalendar/issues/410#issuecomment-300809189","issue_url":"https://api.github.com/repos/patchthecode/JTAppleCalendar/issues/410","id":300809189,"user":{"login":"patchthecode","id":2439146,"avatar_url":"https://avatars3.githubusercontent.com/u/2439146?v=3","gravatar_id":"","url":"https://api.github.com/users/patchthecode","html_url":"https://github.com/patchthecode","followers_url":"https://api.github.com/users/patchthecode/followers","following_url":"https://api.github.com/users/patchthecode/following{/other_user}","gists_url":"https://api.github.com/users/patchthecode/gists{/gist_id}","starred_url":"https://api.github.com/users/patchthecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patchthecode/subscriptions","organizations_url":"https://api.github.com/users/patchthecode/orgs","repos_url":"https://api.github.com/users/patchthecode/repos","events_url":"https://api.github.com/users/patchthecode/events{/privacy}","received_events_url":"https://api.github.com/users/patchthecode/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T14:36:45Z","updated_at":"2017-05-11T14:36:45Z","body":"Hmm. I think you might misunderstand the inDates/outDates for single row calendars.\r\n\r\nI assume the S|M|T|W|T|F|S  header is created by you and is not managed by the calendar right?\r\nSo i think the single row configuration should look like this:\r\n\r\n```swift\r\nreturn ConfigurationParameters(startDate: startDate, endDate: endDate, numberOfRows: 1, generateInDates: .forFirstMonthOnly, generateOutDates: .off, firstDayOfWeek: .sunday)\r\n```"}}
{"actor":{"display_login":"patchthecode"}}