From 8aa43335306ba2aee4d882f13b409903f0c9113d Mon Sep 17 00:00:00 2001 From: German Laullon Date: Thu, 30 Dec 2010 00:17:58 -0800 Subject: [PATCH] correct date --- PBWebHistoryController.m | 10 ++++++++-- html/views/history/history.css | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index b941f62..449e483 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -156,8 +156,14 @@ NSString *rol=[line substringToIndex:r_name_i.location]; NSString *name=[line substringWithRange:NSMakeRange(r_name_i.location,(r_email_i.location-r_name_i.location))]; NSString *email=[line substringWithRange:NSMakeRange(r_email_i.location+1,((r_email_e.location-1)-r_email_i.location))]; - NSString *time=[line substringFromIndex:r_email_e.location+2]; + NSArray *t=[[line substringFromIndex:r_email_e.location+2] componentsSeparatedByString:@" "]; + NSDate *date=[NSDate dateWithTimeIntervalSince1970:[[t objectAtIndex:0] doubleValue]]; + NSDateFormatter* theDateFormatter = [[NSDateFormatter alloc] init]; + [theDateFormatter setDateStyle:NSDateFormatterMediumStyle]; + [theDateFormatter setTimeStyle:NSDateFormatterMediumStyle]; + NSString *dateString=[theDateFormatter stringForObjectValue:date]; + if(![email isEqualToString:last_mail]){ [auths appendString:[NSString stringWithFormat:@"
",rol]]; if([self isFeatureEnabled:@"gravatar"]){ @@ -165,7 +171,7 @@ [auths appendString:[NSString stringWithFormat:@"",hash]]; } [auths appendString:[NSString stringWithFormat:@"

%@ (%@)

",name,rol]]; - [auths appendString:[NSString stringWithFormat:@"

%@

",time]]; + [auths appendString:[NSString stringWithFormat:@"

%@

",dateString]]; } last_mail=email; } diff --git a/html/views/history/history.css b/html/views/history/history.css index ab8e986..c524156 100644 --- a/html/views/history/history.css +++ b/html/views/history/history.css @@ -229,6 +229,8 @@ a.showdiff { #header p.time { margin-top: 2px; + font-size: 11px; + white-space: nowrap; } #header p.name {