by josecastillo · 8y ago · 0 comments
Especially with modern Swift syntax, complex questions like "what's the current day of the year" end up having simple, almost poetic answers like "calendar.ordinality(of: .day, in: .year, for: date)". And you can trust that they are correct for every calendar and every locale. Usually. [2]
[1] https://itunes.apple.com/us/app/better-day-a-complication/id...
[2] https://www.joeycastillo.com/notes/2016/09/18/of-crescent-mo...
Future months are still totally fine; the date offset is just a temporary fix that the user remembers to turn on when the announcement is made, and to turn off at the end of the month.