|
|
|
|
|
by josecastillo
2822 days ago
|
|
I've encountered just about every item on this list working on my Apple Watch complication, Better Day[1], which supports 11 calendar systems in 21 languages. The funny thing is, the last item on this list — always use ICU through the NSCalendar API — is the exact conclusion I arrived at, and one that I preach to anyone who will listen. 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... |
|