mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Added two static initializers to RKDotNetDateFormatter and amended the specs.
This commit is contained in:
@@ -19,6 +19,17 @@ NSTimeInterval millisecondsFromSeconds(NSTimeInterval seconds);
|
||||
|
||||
@implementation RKDotNetDateFormatter
|
||||
|
||||
+ (RKDotNetDateFormatter *)dotNetDateFormatter {
|
||||
return [RKDotNetDateFormatter dotNetDateFormatterWithTimeZone:nil];
|
||||
}
|
||||
|
||||
+ (RKDotNetDateFormatter *)dotNetDateFormatterWithTimeZone:(NSTimeZone *)newTimeZone {
|
||||
RKDotNetDateFormatter *formatter = [[[RKDotNetDateFormatter alloc] init] autorelease];
|
||||
if (newTimeZone)
|
||||
formatter.timeZone = newTimeZone;
|
||||
return formatter;
|
||||
}
|
||||
|
||||
- (NSDate *)dateFromString:(NSString *)string {
|
||||
NSString *milliseconds = [self millisecondsFromString:string];
|
||||
if (!milliseconds) {
|
||||
|
||||
Reference in New Issue
Block a user