Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 12 - Calendar is starting with day as Friday #104

Open
fparkar opened this issue Oct 30, 2018 · 5 comments
Open

iOS 12 - Calendar is starting with day as Friday #104

fparkar opened this issue Oct 30, 2018 · 5 comments

Comments

@fparkar
Copy link

fparkar commented Oct 30, 2018

In iOS 12, days are starting from Friday instead of Sunday. Below are the screenshots for the same.

000001_ios11

000001_ios12

Any idea why this is happening?

@hons82
Copy link
Owner

hons82 commented Oct 30, 2018

There is some adjustment for the locale, as some countries prefer the week to start on Sunday instead of Monday.... But there is obviously an error in that routine...

@fparkar
Copy link
Author

fparkar commented Oct 30, 2018

For now I have done as below way & this is working fine.

In THDatePickerViewController.m, I added below change in redrawWeekdays above for loop that is there....

if (IS_DEVICE_RUNNING_IOS_X_AND_ABOVE(@"12.0")) {
    NSDateComponents *offsetComponents2 = [[NSDateComponents alloc] init];
    [offsetComponents2 setDay:2];
    date = [_calendar dateByAddingComponents:offsetComponents2 toDate:date options:0];
}

But for sure, what I have written above is not correct.

It would be great if you find a fix and let us know.

@fparkar
Copy link
Author

fparkar commented Oct 30, 2018

There is some adjustment for the locale, as some countries prefer the week to start on Sunday instead of Monday.... But there is obviously an error in that routine...

This is not happening in iOS 11 & below. Only iOS 12 have this issues.

@MattFellows
Copy link

I had the same issue which I resolved by updating to v1.3.0 - I had to clean the build folder, and manually delete the THCalendarDatePicker.framework from the ~/Library/DerivedData/<Product>/Build/Products/Debug-iphoneos/THCalendarDatePicker folder, but after doing those things the issue went away for iOS 12 devices

@Oggerschummer
Copy link

I can confirm this is fixed and working with v1.3.0 on 12.2 beta 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants