Summary: | Reimplement getDayBoundaries using NSCalendar | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | ||||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Anders Carlsson
2013-11-14 13:31:54 PST
Created attachment 216973 [details]
Patch
Comment on attachment 216973 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=216973&action=review > Source/WebKit/mac/History/WebHistory.mm:164 > + NSDate *beginningOfDayDate = [calendar startOfDayForDate:date]; > + beginningOfDay = beginningOfDayDate.timeIntervalSinceReferenceDate; > + > + NSDate *beginningOfNextDayDate = [calendar dateByAddingUnit:NSCalendarUnitDay value:1 toDate:beginningOfDayDate options:0]; I believe you can do this with a single method call to -[NSCalendar rangeOfUnit:startDate:interval:forDate:]. Seems wasteful to do two. Created attachment 216975 [details]
Patch
Comment on attachment 216975 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=216975&action=review > Source/WebKit/mac/History/WebHistory.mm:158 > + NSCalendar *calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; I believe NSCalendarIdentifierGregorian and NSCalendarUnitDay aren’t available in some of the SDKs we target. You may need to add #ifdefs around some things here. Created attachment 216977 [details]
Patch
Committed r159311: <http://trac.webkit.org/changeset/159311> |