WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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
Details
Formatted Diff
Diff
Patch
(2.08 KB, patch)
2013-11-14 13:46 PST
,
Anders Carlsson
no flags
Details
Formatted Diff
Diff
Patch
(2.13 KB, patch)
2013-11-14 13:55 PST
,
Anders Carlsson
mitz: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Anders Carlsson
Comment 1
2013-11-14 13:32:46 PST
Created
attachment 216973
[details]
Patch
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
Created
attachment 216975
[details]
Patch
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
Created
attachment 216977
[details]
Patch
Anders Carlsson
Comment 6
2013-11-14 14:00:55 PST
Committed
r159311
: <
http://trac.webkit.org/changeset/159311
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug