Skip to content

Commit ab941df

Browse files
sstiglermmcstigler
authored andcommitted
Removes references to NSDateIntervalFormatter
(It turns out that is used to format a date range, not a time interval.)
1 parent 748f5fe commit ab941df

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

SCTimeIntervalFormatter.h

+3-13
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,10 @@
99
#import <Foundation/Foundation.h>
1010

1111
/**
12-
Formats a time interval (provided in seconds wrapped in an NSNumber) using the following format
13-
template:
14-
0 minutes
15-
15 minutes
16-
30 minutes
17-
45 minutes
18-
1 hour
19-
1 hour, 15 minutes
20-
15 hours, 30 minutes
21-
23 hours, 45 minutes
22-
1 day
12+
Formats a time interval (provided in seconds wrapped in an NSNumber).
2313
24-
@discussion This is a façade that will allow us to conditionally take advantage of OS X 10.10
25-
Yosemite's new @c NSDateIntervalFormatter when it is available.
14+
@discussion This is a façade that will allow us to conditionally take advantage of better time
15+
interval formatting methods as they become available.
2616
*/
2717
@interface SCTimeIntervalFormatter : NSFormatter
2818

SCTimeIntervalFormatter.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ - (NSString *)formatSeconds:(NSTimeInterval)seconds {
3434
return formatted;
3535
}
3636

37-
- (NSString *)formatSecondsUsingModernBehavior:(NSTimeInterval)seconds {
38-
// TODO: Have this use NSDateIntervalFormatter on OS X 10.10 'Yosemite' and above.
39-
37+
- (NSString *)formatSecondsUsingModernBehavior:(NSTimeInterval)seconds
38+
{
4039
static TTTTimeIntervalFormatter* timeIntervalFormatter = nil;
4140
if (timeIntervalFormatter == nil) {
4241
timeIntervalFormatter = [[TTTTimeIntervalFormatter alloc] init];
@@ -56,6 +55,7 @@ - (NSString *)formatSecondsUsingModernBehavior:(NSTimeInterval)seconds {
5655
if ([formatted length] == 0) {
5756
formatted = [self stringIndicatingZeroMinutes];
5857
}
58+
5959
return formatted;
6060
}
6161

0 commit comments

Comments
 (0)