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
Add Date.numberOfDaysInYear #552
Milestone
Comments
imho: name should be |
Actually the code example is extension Date {
var dayInYear: Int {
return Calendar.current.ordinality(of: .day, in: .year, for: self)!
}
var numberOfDaysInYear: Int {
return Calendar.current.range(of: .day, in: .year, for: self)!.upperBound - 1
}
var numberOfDaysLeftInYear: Int {
return numberOfDaysInYear - dayInYear
}
}
Date().numberOfDaysLeftInYear // 81 (for Oct 11, 2018) |
1 task
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[x] I've read, understood, and done my best to follow the Contributing guidelines before opening this issue.
What did you do?
What did you expect to happen?
What happened instead?
SwifterSwift Environment
Demo Project
The text was updated successfully, but these errors were encountered: