Revision d8426ffb pithos-macos/LastCompletedSyncTransformer.m

b/pithos-macos/LastCompletedSyncTransformer.m
2 2
//  LastCompletedSyncTransformer.m
3 3
//  pithos-macos
4 4
//
5
// Copyright 2011 GRNET S.A. All rights reserved.
5
// Copyright 2011-2012 GRNET S.A. All rights reserved.
6 6
//
7 7
// Redistribution and use in source and binary forms, with or
8 8
// without modification, are permitted provided that the following
......
49 49

  
50 50
- (id)transformedValue:(id)value {
51 51
    if (value == nil)
52
		return @"Last Sync: -";
52
		return @"-";
53 53
    
54 54
    NSCalendar *calendar = [NSCalendar currentCalendar];
55 55
    NSDateComponents *comps = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:[NSDate date]];
......
59 59
    NSTimeInterval timeInterval = [[calendar dateFromComponents:comps] timeIntervalSinceDate:(NSDate *)value];
60 60
    if (timeInterval < 86400) {
61 61
        // Today
62
        return [NSString stringWithFormat:@"Last Sync: Today %@", [NSDateFormatter localizedStringFromDate:(NSDate *)value 
62
        return [NSString stringWithFormat:@"Today %@", [NSDateFormatter localizedStringFromDate:(NSDate *)value 
63 63
                                                                                                     dateStyle:NSDateFormatterNoStyle 
64 64
                                                                                                     timeStyle:NSDateFormatterShortStyle]];
65 65
    } else if (timeInterval < 172800) {
66 66
        // Yesterday
67
        return [NSString stringWithFormat:@"Last Sync: Yesterday %@", [NSDateFormatter localizedStringFromDate:(NSDate *)value 
67
        return [NSString stringWithFormat:@"Yesterday %@", [NSDateFormatter localizedStringFromDate:(NSDate *)value 
68 68
                                                                                           dateStyle:NSDateFormatterNoStyle 
69 69
                                                                                           timeStyle:NSDateFormatterShortStyle]];
70 70
    } else {
71
        return [NSString stringWithFormat:@"Last Sync: %@", [NSDateFormatter localizedStringFromDate:(NSDate *)value 
71
        return [NSString stringWithFormat:@"%@", [NSDateFormatter localizedStringFromDate:(NSDate *)value 
72 72
                                                                                           dateStyle:NSDateFormatterShortStyle 
73 73
                                                                                           timeStyle:NSDateFormatterShortStyle]];
74 74
    }

Also available in: Unified diff