Skip to content

Commit

Permalink
解决时间显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xhzengAIB committed Jun 10, 2014
1 parent e252908 commit b44c8b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions RefreshControl/XHRefreshControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ - (void)startPullDownRefreshing {
self.pullDownRefreshing = YES;

NSDate *date = [self.delegate lastUpdateTime];
if (date || [date isKindOfClass:[NSDate class]]) {
self.refreshView.timeLabel.text = [NSString stringWithFormat:@"上次刷新:%@", @"10小时前"];
if ([date isKindOfClass:[NSDate class]] || date) {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];

[dateFormatter setDateFormat:@"MM-dd HH:mm"];

NSString *destDateString = [dateFormatter stringFromDate:date];
self.refreshView.timeLabel.text = [NSString stringWithFormat:@"上次刷新:%@", destDateString];
}

self.refreshState = XHRefreshStatePulling;
Expand Down

0 comments on commit b44c8b5

Please sign in to comment.