RESOLVED FIXED Bug 124379
Reimplement getDayBoundaries using NSCalendar
https://bugs.webkit.org/show_bug.cgi?id=124379
Summary Reimplement getDayBoundaries using NSCalendar
Anders Carlsson
Reported 2013-11-14 13:31:54 PST
Reimplement getDayBoundaries using NSCalendar on 10.9
Attachments
Patch (2.17 KB, patch)
2013-11-14 13:32 PST, Anders Carlsson
no flags
Patch (2.08 KB, patch)
2013-11-14 13:46 PST, Anders Carlsson
no flags
Patch (2.13 KB, patch)
2013-11-14 13:55 PST, Anders Carlsson
mitz: review+
Anders Carlsson
Comment 1 2013-11-14 13:32:46 PST
mitz
Comment 2 2013-11-14 13:37:05 PST
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.
Anders Carlsson
Comment 3 2013-11-14 13:46:50 PST
mitz
Comment 4 2013-11-14 13:50:22 PST
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.
Anders Carlsson
Comment 5 2013-11-14 13:55:41 PST
Anders Carlsson
Comment 6 2013-11-14 14:00:55 PST
Note You need to log in before you can comment on or make changes to this bug.