Permalink
Browse files

Improve date category and tests

  • Loading branch information...
1 parent 5e2a9b6 commit fb1a11f485307c31491bde25fcb1470fd0035f40 @soffes soffes committed May 8, 2012
Showing with 8 additions and 6 deletions.
  1. +0 −2 SSToolkit.xcodeproj/project.pbxproj
  2. +1 −1 SSToolkit/NSDate+SSToolkitAdditions.m
  3. +7 −3 Tests/DateCategoryTest.m
@@ -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 */,
);
@@ -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];
}
View
@@ -24,16 +24,20 @@ - (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);
}
- (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

0 comments on commit fb1a11f

Please sign in to comment.