on 10.6 use localizedStringFromDate:dateStyle:timeStyle: for formatting the blocklist update date
This commit is contained in:
parent
9206b7e107
commit
abe1206e6e
|
@ -27,6 +27,7 @@
|
|||
#import "BlocklistScheduler.h"
|
||||
#import "PortChecker.h"
|
||||
#import "BonjourController.h"
|
||||
#import "NSApplicationAdditions.h"
|
||||
#import "NSStringAdditions.h"
|
||||
#import "UKKQueue.h"
|
||||
#import "utils.h"
|
||||
|
@ -524,12 +525,18 @@ tr_session * fHandle;
|
|||
NSDate * updatedDate = [fDefaults objectForKey: @"BlocklistLastUpdate"];
|
||||
if (updatedDate)
|
||||
{
|
||||
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateStyle: NSDateFormatterFullStyle];
|
||||
[dateFormatter setTimeStyle: NSDateFormatterShortStyle];
|
||||
|
||||
updatedDateString = [dateFormatter stringFromDate: updatedDate];
|
||||
[dateFormatter release];
|
||||
if ([NSApp isOnSnowLeopardOrBetter])
|
||||
updatedDateString = [NSDateFormatter localizedStringFromDate: updatedDate dateStyle: NSDateFormatterFullStyle
|
||||
timeStyle: NSDateFormatterShortStyle];
|
||||
else
|
||||
{
|
||||
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateStyle: NSDateFormatterFullStyle];
|
||||
[dateFormatter setTimeStyle: NSDateFormatterShortStyle];
|
||||
|
||||
updatedDateString = [dateFormatter stringFromDate: updatedDate];
|
||||
[dateFormatter release];
|
||||
}
|
||||
}
|
||||
else
|
||||
updatedDateString = NSLocalizedString(@"N/A", "Prefs -> blocklist -> message");
|
||||
|
|
Loading…
Reference in New Issue