summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
Diffstat (limited to 'Juick')
-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];