Skip to content

Commit 8aa4333

Browse files
committed
correct date
1 parent 3f7a79c commit 8aa4333

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

PBWebHistoryController.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,22 @@ - (NSString *)parseHeader:(NSString *)txt withRefs:(NSString *)badges
156156
NSString *rol=[line substringToIndex:r_name_i.location];
157157
NSString *name=[line substringWithRange:NSMakeRange(r_name_i.location,(r_email_i.location-r_name_i.location))];
158158
NSString *email=[line substringWithRange:NSMakeRange(r_email_i.location+1,((r_email_e.location-1)-r_email_i.location))];
159-
NSString *time=[line substringFromIndex:r_email_e.location+2];
160159

160+
NSArray *t=[[line substringFromIndex:r_email_e.location+2] componentsSeparatedByString:@" "];
161+
NSDate *date=[NSDate dateWithTimeIntervalSince1970:[[t objectAtIndex:0] doubleValue]];
162+
NSDateFormatter* theDateFormatter = [[NSDateFormatter alloc] init];
163+
[theDateFormatter setDateStyle:NSDateFormatterMediumStyle];
164+
[theDateFormatter setTimeStyle:NSDateFormatterMediumStyle];
165+
NSString *dateString=[theDateFormatter stringForObjectValue:date];
166+
161167
if(![email isEqualToString:last_mail]){
162168
[auths appendString:[NSString stringWithFormat:@"<div class='user %@ clearfix'>",rol]];
163169
if([self isFeatureEnabled:@"gravatar"]){
164170
NSString *hash=[self someMethodThatReturnsSomeHashForSomeString:email];
165171
[auths appendString:[NSString stringWithFormat:@"<img class='avatar' src='http://www.gravatar.com/avatar/%@?d=wavatar&s=30'/>",hash]];
166172
}
167173
[auths appendString:[NSString stringWithFormat:@"<p class='name'>%@ <span class='rol'>(%@)</span></p>",name,rol]];
168-
[auths appendString:[NSString stringWithFormat:@"<p class='time'>%@</p></div>",time]];
174+
[auths appendString:[NSString stringWithFormat:@"<p class='time'>%@</p></div>",dateString]];
169175
}
170176
last_mail=email;
171177
}

html/views/history/history.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ a.showdiff {
229229

230230
#header p.time {
231231
margin-top: 2px;
232+
font-size: 11px;
233+
white-space: nowrap;
232234
}
233235

234236
#header p.name {

0 commit comments

Comments
 (0)