Calendar to use for smart groups

Christiaan Hofman <[email protected]> Sat, 6 Nov 2010 14:23:19 +0100
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
In our app we have a notion of smart groups that can also use date conditions, such as "this week" or "in the last month", as in Mail.app's smart mailboxes. These should be properly interpreted in terms of actual data ranges, for which we use NSCalendar. Currently we are using the standard NSCGregorianCalendar for this. However, would it be better to use the currentCalendar instead?

I wonder what Apple's apps like Mail.app do in such cases. I cannot really make sense of what it does though. For instance, a smart mailbox for date received "is this week" always seems to give me dates starting on sunday, no matter if my preferred first weekday is sunday or monday, and this is also not consistent with the standard NSGregorianCalendar, which always has monday as firstWeekDay, so then what is it using?

Christiaan