-
Notifications
You must be signed in to change notification settings - Fork 72
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
Values selected correspond to one day earlier #21
Comments
I am also facing same issue, when i select any date from Date Picker it returning me one date earlier from the selected date. |
I think my initial comment may be right and the issue might be related to different time zones. The calendar should be fully based on UTC (GMT) and time zone neutral. However, I found the following issue related to the extension of NSDate:
This is a convenience initialiser added to NSDate in
Output is as follows for the last three lines of code: As you can see, the individual values are all correct. But the start date is one day earlier. I have not had much time but attempted this change, which for now seems to have fixed the problem. @pushpendra996 - pls test if that fixes the issue for you too and let me know. In EPExtensions.swift I made the following modification adding explicitly UTC. I also set the calendar to Gregorian explicitly (as in my app I do not support other calendar types but that part is optional).
|
When I select a few dates (e.g. 19, 20, 21 June 2016) and then click "done" the actual dates in
arrSelectedDates
are one day earlier (i.e. 18, 19, 20 June 2016). See screen shots below. (Problem is the same if I select a single date or multiple dates).It is very strange. The value of
cell.lblDay.text
is correctly set to 19 (if for example I select 19 June 2016) butcell.currentDate
is set to value 18 June 2016.I tried to modify
cell.currentDate = currentDate
by adding one day to itcell.currentDate = currentDate.dateByAddingDays(1)
. The return values inarrSelectedDates
are then correct. But when I scroll out and scroll back in the wrong dates are highlighted.Could this have something to do with different time zones or is it a completely different problem?
Any idea what could be the issue? I am running iOS 9.3.2 and Xcode 7.3.1. The issue happens on my iPhone as well as different simulators.
The text was updated successfully, but these errors were encountered: