@@ -110,7 +110,7 @@ + (instancetype)objectWithDictionary:(NSDictionary *)dictionary
110
110
if (nil == dictionary || ![dictionary isKindOfClass: [NSDictionary class ]]) {
111
111
return nil ;
112
112
}
113
-
113
+
114
114
if ([dictionary isKindOfClass: [NSNull class ]]) {
115
115
return nil ;
116
116
}
@@ -127,7 +127,7 @@ + (instancetype)objectWithDictionary:(NSDictionary *)dictionary
127
127
if (nil == dictionary || ![dictionary isKindOfClass: [NSDictionary class ]]) {
128
128
return nil ;
129
129
}
130
-
130
+
131
131
if ([dictionary isKindOfClass: [NSNull class ]]) {
132
132
return nil ;
133
133
}
@@ -137,7 +137,6 @@ + (instancetype)objectWithDictionary:(NSDictionary *)dictionary
137
137
mappings: mapping];
138
138
}
139
139
140
-
141
140
//
142
141
- (instancetype )initWithDictionary : (NSDictionary *)dictionary ;
143
142
{
@@ -190,7 +189,6 @@ - (instancetype)initWithDictionary:(NSDictionary *)dictionary
190
189
return self;
191
190
}
192
191
193
-
194
192
// NSCoding
195
193
- (NSArray *)propertyNames {
196
194
NSMutableArray *array = [NSMutableArray array ];
@@ -290,7 +288,7 @@ - (instancetype)updateWithDictionary:(NSDictionary *)dictionary
290
288
[_customFormatter setDateFormat: _customInputDateFormatString];
291
289
}
292
290
_mappings = mapping;
293
-
291
+
294
292
return [self updateWithDictionary: dictionary];
295
293
}
296
294
@@ -302,7 +300,7 @@ - (instancetype)updateWithDictionary:(NSDictionary *)dictionary
302
300
_inputDateFormat = kInputDateFormatCustom ;
303
301
_customFormatter = inputDateFormatter;
304
302
_mappings = mapping;
305
-
303
+
306
304
return [self updateWithDictionary: dictionary];
307
305
}
308
306
@@ -351,6 +349,10 @@ - (void)serializeValue:(id)value withKey:(id)key {
351
349
case kInputDateFormatDotNetWithTimeZone : {
352
350
value = (NSDate *)[_timezoneDateFormatter dateFromString: value];
353
351
} break ;
352
+ case kInputDateFormatCustom : {
353
+ value = (NSDate *)[_customFormatter dateFromString: value];
354
+ } break ;
355
+
354
356
default : { value = (NSDate *)[self dateFromDotNetJSONString: value]; } break ;
355
357
}
356
358
}
@@ -367,6 +369,9 @@ - (void)serializeValue:(id)value withKey:(id)key {
367
369
case kInputDateFormatDotNetWithTimeZone : {
368
370
value = @([[_timezoneDateFormatter dateFromString: value] timeIntervalSince1970 ]);
369
371
} break ;
372
+ case kInputDateFormatCustom : {
373
+ value = @([[_customFormatter dateFromString: value] timeIntervalSince1970 ]);
374
+ } break ;
370
375
default : {
371
376
value = @([[self dateFromDotNetJSONString: value] timeIntervalSince1970 ]);
372
377
} break ;
0 commit comments