CrackBerry Genius of Geniuses
Ask Ars: Why will Apple’s Do Not Disturb bug fix itself next week? | Ars Technica Q: What's causing Apple's Do Not Disturb bug and why will it just miraculously fix itself next week?
Apple has declined to publicly comment on the issue and won't explicitly confirm the reason for the bug. But numerous developers experienced in the complicated world of calendaring have stepped up with their observations and the overall consensus has converged on the ISO week date.
Here's how it works and why it's throwing DND for a loop. The ISO week numbering system uses the YYYY format for the year instead of the Gregorian calendar's yyyy. It then looks at which week of the year it is, and then uses a date digit with 1 starting on Monday. So, for example, Tuesday of the 50th week of 2012 would have been 2012-W50-2 in ISO week format.
The problem comes in when January 1 of the new year ends up falling on a date that doesn't get along well with the ISO week format. The first day of 2013 started on a Tuesday, whereas (as noted by TUAW) the ISO standard expects the first week of the year to start on "the Monday that contains the first Thursday in January." In this case, that would be January 7, 2013."Overall, working with dates and times is difficult in the fact that the littlest mistake can be a major issue due to the edge cases," Patrick McCarron, a senior iOS developer at StandAlone Apps, told Ars on Thursday. "This is a common pitfall that happens at the beginning of the new year and lines up with the time when the bug will go away."
Indeed, iOS developer Chris Cieslak has posted a code sample
that replicates the problem online, showing that it's something many developers can easily fall prey to.What's perplexing is that Apple points out this common mistake in its own date formatting documentation for developers. YYYY specifies the week of the year (ISO) while yyyy specifies the calendar year (Gregorian). "In most cases, yyyy and YYYY yield the same number, however they may be different. Typically you should use the calendar year," writes Apple.
Indeed, Apple. Indeed.