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

endOfDay handles date differently for iOS 10 as it does for iOS 11 #91

Open
ghost opened this issue Feb 22, 2018 · 0 comments
Open

endOfDay handles date differently for iOS 10 as it does for iOS 11 #91

ghost opened this issue Feb 22, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 22, 2018

the first screenshot is the dates being handled by iOS 11. The second screenshot is the dates being handles by iOS 10.

First, there is a row where the exact timestamps pulled from parse are printed, then a row showing what happens to the timestamps after .endOfDay is called and then I try to calculate the number of days between the two dates.

`

     if let start = self.transaction.pickupDate{

        if let end = self.transaction.returnDate{

            print("start date: \(start),  end date: \(end)")

            let days = abs(end.endOfDay.daysFrom(start.endOfDay))

            print("Start Date: \(start.endOfDay), End Date: \(end.endOfDay),  number of days: \(days)")

        }

    }

`

You can see clearly that endOfDay is doing something really weird in iOS 11

screen shot 2018-02-21 at 10 16 01 pm

screen shot 2018-02-21 at 10 14 54 pm

endOfDay might be from an older version of Timepiece that I have. But basically, it does the following: return change(hour: 23, minute: 59, second: 59)

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

0 participants