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

fix wrong direction when selected different month #40

Merged
merged 2 commits into from
Sep 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion THCalendarDatePicker/THDatePickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,14 @@ - (BOOL)setDateTimeZoneWithName:(NSString *)name {
- (void)dateDayTapped:(THDateDay *)dateDay {
if (!_internalDate || [_internalDate timeIntervalSinceDate:dateDay.date] || _allowSelectionOfSelectedDate) { // new date selected
[self.currentDay setSelected:NO];
[self.currentDay setLightText:![self dateInCurrentMonth:self.currentDay.date]];
[dateDay setSelected:YES];
BOOL dateInDifferentMonth = ![self dateInCurrentMonth:dateDay.date];
NSDate *firstOfCurrentMonth = self.firstOfCurrentMonth;
[self setInternalDate:dateDay.date];
[self setCurrentDay:dateDay];
if (dateInDifferentMonth) {
[self slideTransitionViewInDirection:[dateDay.date timeIntervalSinceDate:self.firstOfCurrentMonth]>0 ? UISwipeGestureRecognizerDirectionRight : UISwipeGestureRecognizerDirectionLeft];
[self slideTransitionViewInDirection:[dateDay.date timeIntervalSinceDate:firstOfCurrentMonth]<0 ? UISwipeGestureRecognizerDirectionRight : UISwipeGestureRecognizerDirectionLeft];
}
if ([self.delegate respondsToSelector:@selector(datePicker:selectedDate:)]) {
[self.delegate datePicker:self selectedDate:dateDay.date];
Expand Down
6 changes: 3 additions & 3 deletions THCalendarDatePickerExample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ DEPENDENCIES:

EXTERNAL SOURCES:
THCalendarDatePicker:
:path: "../"
:path: ../

SPEC CHECKSUMS:
KNSemiModalViewController: 8c0056377714b5170c52c65977d540200405411f
THCalendarDatePicker: 5d2b396b690796c45c30925dd0c23943141dbac6
THCalendarDatePicker: 2e481afccfabe1199509872e726e4f8604e27a0c

COCOAPODS: 0.38.2
COCOAPODS: 0.39.0.beta.3
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (IBAction)touchedButton:(id)sender {
//[self.datePicker setDisableFutureSelection:NO];
[self.datePicker setDaysInHistorySelection:1];
[self.datePicker setDaysInFutureSelection:0];
[self.datePicker setDateTimeZoneWithName:@"UTC"];
// [self.datePicker setDateTimeZoneWithName:@"UTC"];
//[self.datePicker setAutoCloseCancelDelay:5.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]];
Expand Down