Hey,

I chose the old format this way because then the 'date' field sorts
correctly if you press on the column header. If you just choose the
system date type, it will sort in any number of (wrong) ways.

To do this correctly, you need to add a value transformer for the
column, and use the raw date type.

- Pieter

On Tuesday, September 1, 2009, Johannes Gilger <[email protected]> wrote:
>
> On 01/09/09 17:38, Development on 7zz wrote:
>> this is a patch for displaying commit timestamp in the format a user has
>> selected in System Preferences:
> Hi there,
>
> cool idea, I like it. It seems like a very Mac-OSy way to do things. I
> didn't even know about the Preference up until now. The question remains
> if other people get the change or if they simply start crying because
> their date-column looks different. Maybe we could add a preference for
> the timestamp in GitX itself, though that would certainly be duplication
> of code (with Mac OS). I for one had to discover that I wanted my
> timestamps exactly the way they were before (i.e. hardcoded in GitX), so
> for me it was a little "extra-effort" to get it back working.
>
> A few words about the patch:
> - I had to apply it with --recount (and it was mangled somewhat)
> - You didn't really supply a commit-message (we can fix that) or a
> committer-name. If you want your name/email associated with that commit
> please tell us which one we should use. I'm gonna push it under my name
> onto my bugfixes-branch for now.
>
> Greetings,
> Jojo
>
>> diff --git a/PBGitCommit.m b/PBGitCommit.m
>> index b883c95..bb24be9 100644
>> --- a/PBGitCommit.m
>> +++ b/PBGitCommit.m
>> @@ -36,7 +36,10 @@ - (NSDate *)date
>>
>> - (NSString *) dateString
>> {
>> -     NSDateFormatter* formatter = [[NSDateFormatter alloc]
>> initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:NO];
>> +    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
>> +    [formatter setLocale: [NSLocale currentLocale]];
>> +    [formatter setDateStyle:kCFDateFormatterMediumStyle];
>> +    [formatter setTimeStyle:kCFDateFormatterMediumStyle];
>>       return [formatter stringFromDate: self.date];
>> }
>
> --
> Johannes Gilger <[email protected]>
> http://heipei.net
> GPG-Key: 0x42F6DE81
> GPG-Fingerprint: BB49 F967 775E BB52 3A81  882C 58EE B178 42F6 DE81
>

Reply via email to