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

TimeZone Change causes Month shown to be wrong. #98

Open
Airtower opened this issue Sep 3, 2018 · 9 comments
Open

TimeZone Change causes Month shown to be wrong. #98

Airtower opened this issue Sep 3, 2018 · 9 comments
Labels

Comments

@Airtower
Copy link

Airtower commented Sep 3, 2018

If you set the Time zone to anything other than default, for ex. GMT. You can select back a month but as soon as you press forward a month with the arrow or a date into the next month, you get the slide transition to the current month forever.

@hons82
Copy link
Owner

hons82 commented Sep 5, 2018

If I get it right, the animation does not stop?
Does that happen to you in the sample?

@hons82 hons82 added the bug label Sep 5, 2018
@Airtower
Copy link
Author

Airtower commented Sep 5, 2018

I'll check on the sample. The animation works except the months can only be decremented and never incremented (next month)

@Airtower
Copy link
Author

Airtower commented Sep 8, 2018

I can't get the sample to work. The Swift version doesn't have a call for a timeZone change in it either. The OBJ-C version does but has issues with the pod file when I try to run it. I can't tell if this issue is isolated to my app or a bug. My app uses the OBJ-C version.

@Airtower
Copy link
Author

To clarify, the animation stops, problem is, it shows the same month as was shown before. If you go back, it shows the previous month but if you press "Next Month" it will show you the same month again.

hons82 pushed a commit that referenced this issue Sep 13, 2018
@hons82
Copy link
Owner

hons82 commented Sep 13, 2018

I'm not using this control in any of my projects since a long time, that's why I'm not actively fixing it.
I've updated all the sample projects and now they should at least start and run. I did not experience this "going to the wrong month" animation so far

@lorenzoPrimi
Copy link

lorenzoPrimi commented Sep 13, 2018

I'm having the same issue, if I set
[self.datePicker setDateTimeZoneWithName:@"UTC"];
the month doesn't change

Here's a quick video for you to check:
https://www.dropbox.com/s/pjuitqbqnz9xddd/with_utc.mov?dl=0
https://www.dropbox.com/s/0uuyli0rl1rld6c/without_utc.mov?dl=0

@lorenzoPrimi
Copy link

@hons82 any way I can help with this?

@Airtower
Copy link
Author

Me too? Ive tried to fix it but can't seem to get it work on my end.

@hons82
Copy link
Owner

hons82 commented Oct 5, 2018

... sorry for the late reply, but I can't dedicate a lot of time to this project anymore...

Unfortunately I still can't reproduce this problem on my end. I did put it in the THCalendarDatePickerExample sample like that

- (IBAction)touchedButton:(id)sender {
    if(!self.datePicker)
        self.datePicker = [THDatePickerViewController datePicker];
    self.datePicker.date = self.curDate;
    self.datePicker.delegate = self;
    [self.datePicker setDateTimeZoneWithName:@"UTC"];
    [self.datePicker setAllowClearDate:NO];
    [self.datePicker setClearAsToday:YES];
    [self.datePicker setAutoCloseOnSelectDate:NO];
    [self.datePicker setAllowSelectionOfSelectedDate:YES];
    [self.datePicker setDisableYearSwitch:YES];
    [self.datePicker setDaysInHistorySelection:12];
    [self.datePicker setDaysInFutureSelection:0];
    [self.datePicker setSelectedBackgroundColor:[UIColor colorWithRed:125/255.0 green:208/255.0 blue:0/255.0 alpha:1.0]];
    [self.datePicker setCurrentDateColor:[UIColor colorWithRed:242/255.0 green:121/255.0 blue:53/255.0 alpha:1.0]];
    [self.datePicker setCurrentDateColorSelected:[UIColor yellowColor]];
    
    [self.datePicker setDateHasItemsCallback:^BOOL(NSDate *date) {
        int tmp = (arc4random() % 30)+1;
        return (tmp % 5 == 0);
    }];
    [self presentSemiViewController:self.datePicker withOptions:@{
                                                                  KNSemiModalOptionKeys.pushParentBack    : @(NO),
                                                                  KNSemiModalOptionKeys.animationDuration : @(1.0),
                                                                  KNSemiModalOptionKeys.shadowOpacity     : @(0.3),
                                                                  }];
}

and everything is working as expected...

I'm on mojave, xcode10 testing on an iPhone XR simulator

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

No branches or pull requests

3 participants