commit | author | age
|
a0a843
|
1 |
// |
H |
2 |
// TWTRDateFormatter.h |
|
3 |
// TwitterKit |
|
4 |
// |
|
5 |
// Created by Joey Carmello on 3/28/15. |
|
6 |
// Copyright (c) 2015 Twitter. All rights reserved. |
|
7 |
// |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
@interface TWTRDateFormatter : NSObject |
|
12 |
|
|
13 |
/** |
|
14 |
* Returns the formatted elapsed time string base on the given date. |
|
15 |
* |
|
16 |
* Logic: |
|
17 |
* - Relative timestamp for anything less than 24 hours |
|
18 |
* - Abbreviated month and day format (Aug 5), and no year for anything within the current year |
|
19 |
* - MM/DD/YY (10/5/14) for anything beyond the current year |
|
20 |
* |
|
21 |
* @param date The date object to calculate elapsed time against. |
|
22 |
* |
|
23 |
* @return Formatted string of the elapsed time from the given date. |
|
24 |
*/ |
|
25 |
+ (NSString *)elapsedTimeStringSinceDate:(NSDate *)date; |
|
26 |
|
|
27 |
@end |