-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a fuzzy date format based on NSDate+TimeAgo. Plan on converting to
https://github.com/MatthewYork/DateTools/tree/master/DateTools once I get feedback from project. See MatthewYork/DateTools#26
- Loading branch information
Chris Wilson
committed
Dec 9, 2014
1 parent
4869882
commit 7c8a209
Showing
37 changed files
with
2,664 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSDate (TimeAgo) | ||
- (NSString *) timeAgoSimple; | ||
- (NSString *) timeAgo; | ||
- (NSString *) timeAgoWithLimit:(NSTimeInterval)limit; | ||
- (NSString *) timeAgoWithLimit:(NSTimeInterval)limit dateFormat:(NSDateFormatterStyle)dFormatter andTimeFormat:(NSDateFormatterStyle)tFormatter; | ||
- (NSString *) timeAgoWithLimit:(NSTimeInterval)limit dateFormatter:(NSDateFormatter *)formatter; | ||
|
||
|
||
// this method only returns "{value} {unit} ago" strings and no "yesterday"/"last month" strings | ||
- (NSString *)dateTimeAgo; | ||
|
||
// this method gives when possible the date compared to the current calendar date: "this morning"/"yesterday"/"last week"/.. | ||
// when more precision is needed (= less than 6 hours ago) it returns the same output as dateTimeAgo | ||
- (NSString *)dateTimeUntilNow; | ||
|
||
@end | ||
|
||
|
||
|
Oops, something went wrong.