summaryrefslogtreecommitdiff
path: root/Juick/MessageCell.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-12-18 06:08:24 +0400
committerGravatar Vitaly Takmazov2013-12-18 06:08:24 +0400
commitae905ed7107078b9681515d14b44b7283bd227e2 (patch)
tree1762cb6516057f7f5009281f51fffaf3f6ab7cf5 /Juick/MessageCell.m
parentce630eef61d4acd8f5c4e1d6a3a60780c5ec4af3 (diff)
timeAgo
Diffstat (limited to 'Juick/MessageCell.m')
-rw-r--r--Juick/MessageCell.m7
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];