Commit 25fc9987 by Dima Bart

Fix dates not being converted from strings in BUYCustomer.

parent 6816f031
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#import "BUYCustomer.h" #import "BUYCustomer.h"
#import "BUYAddress.h" #import "BUYAddress.h"
#import "NSDateFormatter+BUYAdditions.h"
@implementation BUYCustomer @implementation BUYCustomer
...@@ -41,6 +42,8 @@ ...@@ -41,6 +42,8 @@
{ {
[super updateWithDictionary:dictionary]; [super updateWithDictionary:dictionary];
NSDateFormatter *formatter = [NSDateFormatter dateFormatterForPublications];
_taxExempt = dictionary[@"tax_exempt"]; _taxExempt = dictionary[@"tax_exempt"];
_verifiedEmail = dictionary[@"verified_email"]; _verifiedEmail = dictionary[@"verified_email"];
_acceptsMarketing = dictionary[@"accepts_marketing"]; _acceptsMarketing = dictionary[@"accepts_marketing"];
...@@ -55,8 +58,8 @@ ...@@ -55,8 +58,8 @@
_tags = dictionary[@"tags"]; _tags = dictionary[@"tags"];
_ordersCount = dictionary[@"orders_count"]; _ordersCount = dictionary[@"orders_count"];
_totalSpent = dictionary[@"total_spent"]; _totalSpent = dictionary[@"total_spent"];
_createdAt = dictionary[@"created_at"]; _createdAt = [formatter dateFromString:dictionary[@"created_at"]];
_updatedAt = dictionary[@"updated_at"]; _updatedAt = [formatter dateFromString:dictionary[@"updated_at"]];
_addresses = [BUYAddress convertJSONArray:dictionary[@"addresses"]]; _addresses = [BUYAddress convertJSONArray:dictionary[@"addresses"]];
_defaultAddress = [BUYAddress convertObject:dictionary[@"default_address"]]; _defaultAddress = [BUYAddress convertObject:dictionary[@"default_address"]];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment