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

Incorrect date gets selected on using the default select method #580

Closed
mrikh opened this issue Feb 7, 2017 · 0 comments
Closed

Incorrect date gets selected on using the default select method #580

mrikh opened this issue Feb 7, 2017 · 0 comments

Comments

@mrikh
Copy link

mrikh commented Feb 7, 2017

I was facing an issue when trying to implement this cocoapod in swift 3 without using a bridging-header and directly using import FSCalender.

Inside of viewDidAppear i used the following line: calendarView.select(currentDate) and saw that the previous day gets selected. Example: I pass 7th February and it shows 6th February selected. But if i manually tap the date, and not use the default function, the correct date gets selected. Same is the problem for calendarView.deselect(currentDate).

On debugging the issue, I saw that on using the function select inside the following method:
(void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate atMonthPosition:(FSCalendarMonthPosition)monthPosition
the targetDate is coming to be one day before the actual passed date inside of the function.

Printing description of targetDate:
2017-02-06 18:30:00 +0000
Printing description of date:
2017-02-07 10:04:54 +0000

But when i manually select the date by tapping, it shows the same targetDate as the date i tapped.

Additionally, I am using the same code using a bridging header and it works perfectly fine.

Also, this issue gets resolved if i comment the code generating the new targetDate and instead use the date passed in the argument as the targetDate. Would i be breaking any functionality by doing so? And why is the previous date getting selected?

Device: iPhone 6s+
Xcode : 8.0
FSCalendar version : Latest

@mrikh mrikh closed this as completed Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant