{"action":"created","issue":{"url":"https://api.github.com/repos/WenchaoD/FSCalendar/issues/843","repository_url":"https://api.github.com/repos/WenchaoD/FSCalendar","labels_url":"https://api.github.com/repos/WenchaoD/FSCalendar/issues/843/labels{/name}","comments_url":"https://api.github.com/repos/WenchaoD/FSCalendar/issues/843/comments","events_url":"https://api.github.com/repos/WenchaoD/FSCalendar/issues/843/events","html_url":"https://github.com/WenchaoD/FSCalendar/issues/843","id":280798560,"node_id":"MDU6SXNzdWUyODA3OTg1NjA=","number":843,"title":"Date selection and Header title displaying wrong dates, months and year in arabic","user":{"login":"hamzakhanfcb10","id":29090211,"node_id":"MDQ6VXNlcjI5MDkwMjEx","avatar_url":"https://avatars1.githubusercontent.com/u/29090211?v=4","gravatar_id":"","url":"https://api.github.com/users/hamzakhanfcb10","html_url":"https://github.com/hamzakhanfcb10","followers_url":"https://api.github.com/users/hamzakhanfcb10/followers","following_url":"https://api.github.com/users/hamzakhanfcb10/following{/other_user}","gists_url":"https://api.github.com/users/hamzakhanfcb10/gists{/gist_id}","starred_url":"https://api.github.com/users/hamzakhanfcb10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamzakhanfcb10/subscriptions","organizations_url":"https://api.github.com/users/hamzakhanfcb10/orgs","repos_url":"https://api.github.com/users/hamzakhanfcb10/repos","events_url":"https://api.github.com/users/hamzakhanfcb10/events{/privacy}","received_events_url":"https://api.github.com/users/hamzakhanfcb10/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-12-10T10:23:21Z","updated_at":"2018-07-25T07:09:54Z","closed_at":null,"author_association":"NONE","body":"Hi @WenchaoD ,\r\n\r\nI am using your awesome library again but this time in Arabic in xcode 9 ios 11. I am facing this issue in RLT. When i change the system language the header title is displaying irrelevant date.\r\n\r\n<img width=\"446\" alt=\"screen shot 2017-12-10 at 3 15 42 pm\" src=\"https://user-images.githubusercontent.com/29090211/33803978-af815d1a-ddbd-11e7-9212-b748a2c8c85e.png\">\r\n\r\nThis is the code for initial calendar setup.\r\n```\r\n func setupCalendar(calendarView : FSCalendar){\r\n        calendarView.allowsMultipleSelection = false\r\n        calendarView.scrollDirection = .horizontal\r\n        calendarView.scrollEnabled = true\r\n        calendarView.swipeToChooseGesture.isEnabled = true\r\n        calendarView.calendarHeaderView.backgroundColor = UIColor.init(hex: \"131114\")\r\n        calendarView.bottomBorder.backgroundColor = UIColor.clear\r\n        calendarView.appearance.headerDateFormat = \"MMMM - YYYY\"\r\n        calendarView.appearance.caseOptions = [.headerUsesUpperCase,.weekdayUsesSingleUpperCase]\r\n        calendarView.appearance.borderRadius = 0.2\r\n        calendarView.appearance.todayColor = currenDateColor\r\n        calendarView.appearance.todaySelectionColor = currenDateColor\r\n         calendarView.today = nil\r\n}\r\n\r\n  func minimumDate(for calendar: FSCalendar) -> Date {\r\n        return Date()\r\n    }\r\n\r\n func moveBack(calendarView : FSCalendar){\r\n        \r\n     \r\n          var val = -1\r\n        if language.currentAppleLanguage() == \"ar\"{\r\n            val = 1\r\n        }\r\n        \r\n        \r\n\r\n        let gregorian = NSCalendar.init(calendarIdentifier: .gregorian)\r\n        \r\n        let mmdate = gregorian?.date(byAdding: .month, value: val, to: calendarView.currentPage, options: [])\r\n        calendarView.setCurrentPage(mmdate!, animated: true)\r\n        \r\n     //   let previousMonth = self.gre\r\n        \r\n//        let previousMonth = calendarView.date(bySubstractingMonths: val, from: calendarView.currentPage)\r\n//        calendarView.setCurrentPage(previousMonth, animated: true)\r\n//\r\n    }\r\n    \r\n    func moveForward(calendarView : FSCalendar){\r\n      \r\n        var val = 1\r\n        if language.currentAppleLanguage() == \"ar\"{\r\n            val = -1\r\n        }\r\n        let gregorian = NSCalendar.init(calendarIdentifier: .gregorian)\r\n        let mmdate = gregorian?.date(byAdding: .month, value: val, to: calendarView.currentPage, options: .matchLast)\r\n        calendarView.setCurrentPage(mmdate!, animated: true)\r\n        \r\n        \r\n    }\r\n\r\n```\r\n\r\nAs you can see the date in header is not correct. When i select a date from the calendar it is displaying wrong date value.\r\n\r\n\r\nNeed help urgently please. Thanks \r\n"},"comment":{"url":"https://api.github.com/repos/WenchaoD/FSCalendar/issues/comments/407656600","html_url":"https://github.com/WenchaoD/FSCalendar/issues/843#issuecomment-407656600","issue_url":"https://api.github.com/repos/WenchaoD/FSCalendar/issues/843","id":407656600,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzY1NjYwMA==","user":{"login":"Husseinhj","id":27139702,"node_id":"MDQ6VXNlcjI3MTM5NzAy","avatar_url":"https://avatars2.githubusercontent.com/u/27139702?v=4","gravatar_id":"","url":"https://api.github.com/users/Husseinhj","html_url":"https://github.com/Husseinhj","followers_url":"https://api.github.com/users/Husseinhj/followers","following_url":"https://api.github.com/users/Husseinhj/following{/other_user}","gists_url":"https://api.github.com/users/Husseinhj/gists{/gist_id}","starred_url":"https://api.github.com/users/Husseinhj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Husseinhj/subscriptions","organizations_url":"https://api.github.com/users/Husseinhj/orgs","repos_url":"https://api.github.com/users/Husseinhj/repos","events_url":"https://api.github.com/users/Husseinhj/events{/privacy}","received_events_url":"https://api.github.com/users/Husseinhj/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T07:09:54Z","updated_at":"2018-07-25T07:09:54Z","author_association":"NONE","body":"@VidyaRajan7 \r\nIt's really simple, Look the [example](https://github.com/Husseinhj/FSCalendar/blob/master/Example-Objc/RangePickerViewController.m) and use your locale and calendar except for Persian. Like this :\r\n```objectivec\r\n\r\n- (void)loadView\r\n{\r\n    UIView *view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];\r\n    view.backgroundColor = [UIColor whiteColor];\r\n    self.view = view;\r\n    \r\n    FSCalendar *calendar = [[FSCalendar alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame), view.frame.size.width, view.frame.size.height - CGRectGetMaxY(self.navigationController.navigationBar.frame))];\r\n    \r\n    calendar.locale = [NSLocale localeWithLocaleIdentifier:@\"ar_SA\"];\r\n    calendar.identifier = NSCalendarIdentifierIslamic; //or NSCalendarIdentifierIslamicCivil \r\n    calendar.firstWeekday = 7;\r\n\r\n. . . . . .  . .\r\n\r\n}\r\n\r\n- (void)viewDidLoad\r\n{\r\n    [super viewDidLoad];\r\n    \r\n    self.gregorian = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierIslamic];\r\n    self.dateFormatter = [[NSDateFormatter alloc] init];\r\n    self.dateFormatter.dateFormat = @\"yyyy-MM-dd\";\r\n    \r\n    // Uncomment this to perform an 'initial-week-scope'\r\n    // self.calendar.scope = FSCalendarScopeWeek;\r\n    \r\n    // For UITest\r\n    self.calendar.accessibilityIdentifier = @\"calendar\";\r\n}\r\n```"}}
{"actor":{"display_login":"Husseinhj"}}