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

days between two dates gives "reverse intervals are not allowed" #339

Closed
callagga opened this issue Nov 25, 2016 · 0 comments
Closed

days between two dates gives "reverse intervals are not allowed" #339

callagga opened this issue Nov 25, 2016 · 0 comments
Labels
Milestone

Comments

@callagga
Copy link

callagga commented Nov 25, 2016

Trying to calculate number of days between two dates but getting an error. Is this a bug? If not how would you recommend I get number of days between two dates?

let firstDayOfWeek = 2 // Monday
let today = Date().startOfDay
let startOfWeek = today - (today.weekday - firstDayOfWeek).days
let date1 : Date = Date() + 8.days
let daysBetween = date1 - startOfWeek   // ERROR

fatal error: Reverse intervals are not allowed: file

@malcommac malcommac added this to the 4.0.8 milestone Nov 30, 2016
@malcommac malcommac added the bug label Nov 30, 2016
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

2 participants