+- (NSArray *) sectionsForPackages:(NSMutableArray *)packages {
+ if (sectioned_)
+ return [super sectionsForPackages:packages];
+
+ CFDateFormatterRef formatter(CFDateFormatterCreate(NULL, Locale_, kCFDateFormatterLongStyle, kCFDateFormatterNoStyle));
+
+ NSMutableArray *sections([NSMutableArray arrayWithCapacity:16]);
+
+ Section *section;
+
+ time_t last(0);
+
+ for (size_t offset(0), count([packages count]); offset != count; ++offset) {
+ Package *package([packages objectAtIndex:offset]);
+
+ time_t updated([package updated]);
+ updated -= updated % (60 * 60 * 24);
+
+ if (updated != last) {
+ last = updated;
+
+ NSString *name;
+ name = (NSString *) CFDateFormatterCreateStringWithDate(NULL, formatter, (CFDateRef) [NSDate dateWithTimeIntervalSince1970:updated]);
+ [name autorelease];
+
+ section = [[[Section alloc] initWithName:name row:offset localize:NO] autorelease];
+ [sections addObject:section];
+ }
+
+ [section addToCount];
+ }
+
+ CFRelease(formatter);
+ return sections;
+}
+