diff options
author | Vitaly Takmazov | 2013-12-18 06:08:24 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2013-12-18 06:08:24 +0400 |
commit | ae905ed7107078b9681515d14b44b7283bd227e2 (patch) | |
tree | 1762cb6516057f7f5009281f51fffaf3f6ab7cf5 /Juick | |
parent | ce630eef61d4acd8f5c4e1d6a3a60780c5ec4af3 (diff) |
timeAgo
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/MessageCell.m | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Juick/MessageCell.m b/Juick/MessageCell.m index 0dea69a..04a08b3 100644 --- a/Juick/MessageCell.m +++ b/Juick/MessageCell.m @@ -9,6 +9,7 @@ #import "MessageCell.h" #import "ColorScheme.h" #import <SDWebImage/UIImageView+WebCache.h> +#import "NSDate+TimeAgo.h" @interface MessageCell () @@ -145,7 +146,11 @@ [self.avatar setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://i.juick.com/as/%d.png", [msg.userID intValue]]]]; __weak MessageCell *weakSelf = self; self.titleLabel.text = msg.user; - self.timestampLabel.text = msg.timestamp; + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; + [formatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]]; + + self.timestampLabel.text = [[formatter dateFromString:msg.timestamp] timeAgo]; if (msg.repliesCount > 0) { if ([msg.repliesBy length] > 0) { self.summaryLabel.text = [NSString stringWithFormat:@"%@ replies by %@", msg.repliesCount, msg.repliesBy]; |