Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve date category and tests

  • Loading branch information...
commit fb1a11f485307c31491bde25fcb1470fd0035f40 1 parent 5e2a9b6
Sam Soffes authored
2  SSToolkit.xcodeproj/project.pbxproj
View
@@ -109,7 +109,6 @@
B24E9E80121DC29A0085F81E /* UIViewController+SSToolkitAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E42121DC29A0085F81E /* UIViewController+SSToolkitAdditions.m */; };
B25C8E601394327000DE7BFF /* SSCollectionViewExtremityTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B2B456FC139078B80060C279 /* SSCollectionViewExtremityTableViewCell.m */; };
B25C8E611394327000DE7BFF /* SSCollectionViewExtremityTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = B2B456FB139078B80060C279 /* SSCollectionViewExtremityTableViewCell.h */; };
- B26679B4151BB5D000BFDF6E /* SSConcurrentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E11121DC29A0085F81E /* SSConcurrentOperation.m */; };
B267D3451226CE0400B66519 /* SSCollectionViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B267D3431226CE0400B66519 /* SSCollectionViewController.h */; };
B267D3461226CE0400B66519 /* SSCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B267D3441226CE0400B66519 /* SSCollectionViewController.m */; };
B2721BA0132F136C00D762FD /* SSCollectionViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B2721B9F132F136C00D762FD /* SSCollectionViewInternal.h */; };
@@ -959,7 +958,6 @@
B229B469144CE2F500F71626 /* SSCollectionViewTableView.m in Sources */,
9EB278B114BBC4360077194C /* SSConcurrentOperation.m in Sources */,
B2C50815151BAB4000E94614 /* NSBundle+SSToolkitAdditions.m in Sources */,
- B26679B4151BB5D000BFDF6E /* SSConcurrentOperation.m in Sources */,
B2F72A141534D54C00556B66 /* SSRateLimit.m in Sources */,
B2C7ED6D153A5624006ABE73 /* SSButton.m in Sources */,
);
2  SSToolkit/NSDate+SSToolkitAdditions.m
View
@@ -76,7 +76,7 @@ - (NSString *)ISO8601String {
time_t rawtime = (time_t)[self timeIntervalSince1970];
timeinfo = gmtime(&rawtime);
- strftime(buffer, 80, "%Y-%m-%@T%H:%M:%SZ", timeinfo);
+ strftime(buffer, 80, "%Y-%m-%dT%H:%M:%SZ", timeinfo);
return [NSString stringWithCString:buffer encoding:NSUTF8StringEncoding];
}
10 Tests/DateCategoryTest.m
View
@@ -24,9 +24,9 @@ - (void)testDateFromISO8601String {
NSString *string = @"2011-01-31T19:42:36Z";
GHAssertEqualObjects(date, [NSDate dateFromISO8601String:string], nil);
-// date = [NSDate dateWithTimeIntervalSince1970:1323818220];
-// string = @"2011-12-13T17:17:00-06:00";
-// GHAssertEqualObjects(date, [NSDate dateFromISO8601String:string], nil);
+ date = [NSDate dateWithTimeIntervalSince1970:1323818220];
+ string = @"2011-12-13T17:17:00-06:00";
+ GHAssertEqualObjects(date, [NSDate dateFromISO8601String:string], nil);
}
@@ -34,6 +34,10 @@ - (void)testISO8601String {
NSDate *date = [NSDate dateWithTimeIntervalSince1970:1296502956];
NSString *string = @"2011-01-31T19:42:36Z";
GHAssertEqualObjects(string, [date ISO8601String], nil);
+
+ date = [NSDate dateWithTimeIntervalSince1970:1336467079];
+ string = @"2012-05-08T08:51:19Z";
+ GHAssertEqualObjects(string, [date ISO8601String], nil);
}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.