mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
make dates in the tracker tab relative (say Today instead of September 27, 2009 for example)
This commit is contained in:
parent
87a48834cb
commit
298af84273
1 changed files with 16 additions and 24 deletions
|
@ -54,21 +54,17 @@
|
|||
{
|
||||
NSString * dateString;
|
||||
if (fStat.hasAnnounced && fStat.lastAnnounceTime != 0)
|
||||
{
|
||||
NSDate * announceDate = [NSDate dateWithTimeIntervalSince1970: fStat.lastAnnounceTime];
|
||||
if ([NSApp isOnSnowLeopardOrBetter])
|
||||
dateString = [NSDateFormatter localizedStringFromDate: announceDate dateStyle: NSDateFormatterFullStyle
|
||||
timeStyle: NSDateFormatterShortStyle];
|
||||
else
|
||||
{
|
||||
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateStyle: NSDateFormatterFullStyle];
|
||||
[dateFormatter setTimeStyle: NSDateFormatterShortStyle];
|
||||
|
||||
dateString = [dateFormatter stringFromDate: announceDate];
|
||||
if ([NSApp isOnSnowLeopardOrBetter])
|
||||
[dateFormatter setDoesRelativeDateFormatting: YES];
|
||||
|
||||
dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastAnnounceTime]];
|
||||
[dateFormatter release];
|
||||
}
|
||||
}
|
||||
else
|
||||
dateString = NSLocalizedString(@"N/A", "Tracker last announce");
|
||||
|
||||
|
@ -102,21 +98,17 @@
|
|||
{
|
||||
NSString * dateString;
|
||||
if (fStat.hasScraped && fStat.lastScrapeTime != 0)
|
||||
{
|
||||
NSDate * scrapeDate = [NSDate dateWithTimeIntervalSince1970: fStat.lastScrapeTime];
|
||||
if ([NSApp isOnSnowLeopardOrBetter])
|
||||
dateString = [NSDateFormatter localizedStringFromDate: scrapeDate dateStyle: NSDateFormatterFullStyle
|
||||
timeStyle: NSDateFormatterShortStyle];
|
||||
else
|
||||
{
|
||||
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateStyle: NSDateFormatterFullStyle];
|
||||
[dateFormatter setTimeStyle: NSDateFormatterShortStyle];
|
||||
|
||||
dateString = [dateFormatter stringFromDate: scrapeDate];
|
||||
if ([NSApp isOnSnowLeopardOrBetter])
|
||||
[dateFormatter setDoesRelativeDateFormatting: YES];
|
||||
|
||||
dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastScrapeTime]];
|
||||
[dateFormatter release];
|
||||
}
|
||||
}
|
||||
else
|
||||
dateString = NSLocalizedString(@"N/A", "Tracker last announce");
|
||||
|
||||
|
|
Loading…
Reference in a new issue