Skip to content
Browse files

rename createDate: to dateWithYear:

  • Loading branch information...
1 parent 2af6578 commit cee857d1c184b73a73f2a4c37738aa5f155c677f @oscardelben committed
View
64 DateCalculations.xcodeproj/oscardelben.pbxuser
@@ -68,33 +68,33 @@
PBXFileDataSource_Target_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 321007074;
- PBXWorkspaceStateSaveDate = 321007074;
+ PBXPerProjectTemplateStateSaveDate = 321438759;
+ PBXWorkspaceStateSaveDate = 321438759;
};
perUserProjectItems = {
- BF57197713222ECE0079C9B9 /* PBXTextBookmark */ = BF57197713222ECE0079C9B9 /* PBXTextBookmark */;
- BF57197813222ECE0079C9B9 /* PBXTextBookmark */ = BF57197813222ECE0079C9B9 /* PBXTextBookmark */;
- BF57197913222ECE0079C9B9 /* PBXTextBookmark */ = BF57197913222ECE0079C9B9 /* PBXTextBookmark */;
- BF57197A13222ECE0079C9B9 /* PBXTextBookmark */ = BF57197A13222ECE0079C9B9 /* PBXTextBookmark */;
- BF57197B13222ECE0079C9B9 /* PBXTextBookmark */ = BF57197B13222ECE0079C9B9 /* PBXTextBookmark */;
- BF57197C13222ECE0079C9B9 /* PBXTextBookmark */ = BF57197C13222ECE0079C9B9 /* PBXTextBookmark */;
- BF57197D13222ECE0079C9B9 /* PBXTextBookmark */ = BF57197D13222ECE0079C9B9 /* PBXTextBookmark */;
- BF57197E13222ECE0079C9B9 /* PBXTextBookmark */ = BF57197E13222ECE0079C9B9 /* PBXTextBookmark */;
- BF57199913222F980079C9B9 /* PBXTextBookmark */ = BF57199913222F980079C9B9 /* PBXTextBookmark */;
- BF57199A13222F980079C9B9 /* PBXTextBookmark */ = BF57199A13222F980079C9B9 /* PBXTextBookmark */;
- BF57199B13222F980079C9B9 /* PBXTextBookmark */ = BF57199B13222F980079C9B9 /* PBXTextBookmark */;
- BF57199C13222F980079C9B9 /* PBXTextBookmark */ = BF57199C13222F980079C9B9 /* PBXTextBookmark */;
- BF57199D13222F980079C9B9 /* PBXTextBookmark */ = BF57199D13222F980079C9B9 /* PBXTextBookmark */;
- BF5719C1132232FC0079C9B9 /* PBXTextBookmark */ = BF5719C1132232FC0079C9B9 /* PBXTextBookmark */;
- BF5719C2132232FC0079C9B9 /* PBXTextBookmark */ = BF5719C2132232FC0079C9B9 /* PBXTextBookmark */;
- BF5719C3132232FC0079C9B9 /* PBXTextBookmark */ = BF5719C3132232FC0079C9B9 /* PBXTextBookmark */;
- BF5719C4132232FC0079C9B9 /* PBXTextBookmark */ = BF5719C4132232FC0079C9B9 /* PBXTextBookmark */;
- BF5719C5132232FC0079C9B9 /* PBXTextBookmark */ = BF5719C5132232FC0079C9B9 /* PBXTextBookmark */;
- BF5719C6132232FC0079C9B9 /* PBXTextBookmark */ = BF5719C6132232FC0079C9B9 /* PBXTextBookmark */;
- BF5719E41322348B0079C9B9 /* PBXTextBookmark */ = BF5719E41322348B0079C9B9 /* PBXTextBookmark */;
- BF5719E51322348B0079C9B9 /* PBXTextBookmark */ = BF5719E51322348B0079C9B9 /* PBXTextBookmark */;
- BF5719E61322348B0079C9B9 /* PBXTextBookmark */ = BF5719E61322348B0079C9B9 /* PBXTextBookmark */;
- BF5719E71322348B0079C9B9 /* PBXTextBookmark */ = BF5719E71322348B0079C9B9 /* PBXTextBookmark */;
+ BF57197713222ECE0079C9B9 = BF57197713222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57197813222ECE0079C9B9 = BF57197813222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57197913222ECE0079C9B9 = BF57197913222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57197A13222ECE0079C9B9 = BF57197A13222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57197B13222ECE0079C9B9 = BF57197B13222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57197C13222ECE0079C9B9 = BF57197C13222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57197D13222ECE0079C9B9 = BF57197D13222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57197E13222ECE0079C9B9 = BF57197E13222ECE0079C9B9 /* PBXTextBookmark */;
+ BF57199913222F980079C9B9 = BF57199913222F980079C9B9 /* PBXTextBookmark */;
+ BF57199A13222F980079C9B9 = BF57199A13222F980079C9B9 /* PBXTextBookmark */;
+ BF57199B13222F980079C9B9 = BF57199B13222F980079C9B9 /* PBXTextBookmark */;
+ BF57199C13222F980079C9B9 = BF57199C13222F980079C9B9 /* PBXTextBookmark */;
+ BF57199D13222F980079C9B9 = BF57199D13222F980079C9B9 /* PBXTextBookmark */;
+ BF5719C1132232FC0079C9B9 = BF5719C1132232FC0079C9B9 /* PBXTextBookmark */;
+ BF5719C2132232FC0079C9B9 = BF5719C2132232FC0079C9B9 /* PBXTextBookmark */;
+ BF5719C3132232FC0079C9B9 = BF5719C3132232FC0079C9B9 /* PBXTextBookmark */;
+ BF5719C4132232FC0079C9B9 = BF5719C4132232FC0079C9B9 /* PBXTextBookmark */;
+ BF5719C5132232FC0079C9B9 = BF5719C5132232FC0079C9B9 /* PBXTextBookmark */;
+ BF5719C6132232FC0079C9B9 = BF5719C6132232FC0079C9B9 /* PBXTextBookmark */;
+ BF5719E41322348B0079C9B9 = BF5719E41322348B0079C9B9 /* PBXTextBookmark */;
+ BF5719E51322348B0079C9B9 = BF5719E51322348B0079C9B9 /* PBXTextBookmark */;
+ BF5719E61322348B0079C9B9 = BF5719E61322348B0079C9B9 /* PBXTextBookmark */;
+ BF5719E71322348B0079C9B9 = BF5719E71322348B0079C9B9 /* PBXTextBookmark */;
};
sourceControlManager = BF57195A13222DE50079C9B9 /* Source Control */;
userBuildSettings = {
@@ -105,9 +105,9 @@
};
5507B7AC131A7EDE001918DB /* DateCalculationsTest.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1007, 4641}}";
+ sepNavIntBoundsRect = "{{0, 0}, {1007, 4602}}";
sepNavSelRange = "{4213, 0}";
- sepNavVisRange = "{3638, 1035}";
+ sepNavVisRange = "{1386, 1112}";
};
};
5507B7B2131A7F72001918DB /* NSDate+Calculations.h */ = {
@@ -117,11 +117,6 @@
name = "NSDate+Calculations.h";
path = "/Users/oscardelben/projects/cocoa/DateCalculations/DateCalculations/NSDate+Calculations.h";
sourceTree = "<absolute>";
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1007, 663}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{0, 886}";
- };
};
5507B7B3131A7F72001918DB /* NSDate+Calculations.m */ = {
isa = PBXFileReference;
@@ -130,11 +125,6 @@
name = "NSDate+Calculations.m";
path = "/Users/oscardelben/projects/cocoa/DateCalculations/DateCalculations/NSDate+Calculations.m";
sourceTree = "<absolute>";
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1007, 4290}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{0, 953}";
- };
};
BF57194013222DE20079C9B9 /* DateCalculations */ = {
isa = PBXExecutable;
View
3 DateCalculations/NSDate+Calculations.h
@@ -11,7 +11,8 @@
@interface NSDate (Calculations)
-+ (NSDate *)createDate:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second;
++ (NSDate *)dateWithYear:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second;
++ (NSDate *)createDate:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second; /* DEPRECATED */
- (NSDate *)beginningOfDay;
- (NSDate *)beginningOfMonth;
View
8 DateCalculations/NSDate+Calculations.m
@@ -11,7 +11,7 @@
@implementation NSDate (Calculations)
-+ (NSDate *)createDate:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second
++ (NSDate *)dateWithYear:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second
{
NSDateComponents *comps = [[[NSDateComponents alloc] init] autorelease];
[comps setYear:year];
@@ -24,6 +24,12 @@ + (NSDate *)createDate:(int)year month:(int)month day:(int)day hour:(int)hour mi
return [[NSCalendar currentCalendar] dateFromComponents:comps];
}
++ (NSDate *)createDate:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second
+{
+ NSLog(@"createDate:month:day:hour:minute:second has been deprecated. Use dateWithYear:month:day:hour:minute:second");
+ return [self dateWithYear:year month:month day:day hour:hour minute:minute second:second];
+}
+
#pragma mark -
#pragma mark Beginning of
View
3 Readme
@@ -6,7 +6,8 @@ To use, simply drop the DateCalculations subdirectory inside your project and re
Currently implemented methods:
-+ (NSDate *)createDate:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second;
++ (NSDate *)dateWithYear:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second;
++ (NSDate *)createDate:(int)year month:(int)month day:(int)day hour:(int)hour minute:(int)minute second:(int)second; /* DEPRECATED */
- (NSDate *)beginningOfDay;
- (NSDate *)beginningOfMonth;
View
30 Test/DateCalculationsTest.m
@@ -23,7 +23,7 @@ @implementation DateCalculationsTest
// 2011 06 23 - 10:15:00
- (NSDate *)defaultDate
{
- return [NSDate createDate:2011 month:6 day:23 hour:10 minute:15 second:0];
+ return [NSDate dateWithYear:2011 month:6 day:23 hour:10 minute:15 second:0];
}
- (NSString *)formattedDate:(NSDate *)date
@@ -57,7 +57,7 @@ - (void)testBeginningOfMonth;
- (void)testBeginningOfQuarter1
{
- NSDate *date = [NSDate createDate:2011 month:2 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:2 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date beginningOfQuarter]];
NSString *expected = @"2011 01 01 - 00:00:00";
@@ -66,7 +66,7 @@ - (void)testBeginningOfQuarter1
- (void)testBeginningOfQuarter2
{
- NSDate *date = [NSDate createDate:2011 month:5 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:5 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date beginningOfQuarter]];
NSString *expected = @"2011 04 01 - 00:00:00";
@@ -75,7 +75,7 @@ - (void)testBeginningOfQuarter2
- (void)testBeginningOfQuarter3
{
- NSDate *date = [NSDate createDate:2011 month:9 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:9 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date beginningOfQuarter]];
NSString *expected = @"2011 07 01 - 00:00:00";
@@ -84,7 +84,7 @@ - (void)testBeginningOfQuarter3
- (void)testBeginningOfQuarter4
{
- NSDate *date = [NSDate createDate:2011 month:12 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:12 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date beginningOfQuarter]];
NSString *expected = @"2011 10 01 - 00:00:00";
@@ -128,7 +128,7 @@ - (void)testEndOfMonth
- (void)testEndOfQuarter1
{
- NSDate *date = [NSDate createDate:2011 month:2 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:2 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date endOfQuarter]];
NSString *expected = @"2011 03 31 - 23:59:59";
@@ -137,7 +137,7 @@ - (void)testEndOfQuarter1
- (void)testEndOfQuarter2
{
- NSDate *date = [NSDate createDate:2011 month:5 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:5 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date endOfQuarter]];
NSString *expected = @"2011 06 30 - 23:59:59";
@@ -146,7 +146,7 @@ - (void)testEndOfQuarter2
- (void)testEndOfQuarter3
{
- NSDate *date = [NSDate createDate:2011 month:9 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:9 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date endOfQuarter]];
NSString *expected = @"2011 09 30 - 23:59:59";
@@ -155,7 +155,7 @@ - (void)testEndOfQuarter3
- (void)testEndOfQuarter4
{
- NSDate *date = [NSDate createDate:2011 month:12 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:12 day:14 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date endOfQuarter]];
NSString *expected = @"2011 12 31 - 23:59:59";
@@ -214,7 +214,7 @@ - (void)testChange
- (void)testDaysInMonth
{
- NSDate *date = [NSDate createDate:2011 month:8 day:14 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:8 day:14 hour:13 minute:12 second:0];
int result = [date daysInMonth];
int expected = 31;
@@ -239,7 +239,7 @@ - (void)testYearsSince
- (void)testNextMonth
{
- NSDate *date = [NSDate createDate:2011 month:8 day:31 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2011 month:8 day:31 hour:13 minute:12 second:0];
NSString *result = [self formattedDate:[date nextMonth]];
NSString *expected = @"2011 09 30 - 13:12:00";
@@ -304,7 +304,7 @@ - (void)testTomorrow
- (void)testFuture1
{
- NSDate *date = [NSDate createDate:2001 month:8 day:31 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2001 month:8 day:31 hour:13 minute:12 second:0];
BOOL result = [date future];
BOOL expected = FALSE;
@@ -313,7 +313,7 @@ - (void)testFuture1
- (void)testFuture2
{
- NSDate *date = [NSDate createDate:2111 month:8 day:31 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2111 month:8 day:31 hour:13 minute:12 second:0];
BOOL result = [date future];
BOOL expected = TRUE;
@@ -322,7 +322,7 @@ - (void)testFuture2
- (void)testPast1
{
- NSDate *date = [NSDate createDate:2001 month:8 day:31 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2001 month:8 day:31 hour:13 minute:12 second:0];
BOOL result = [date past];
BOOL expected = TRUE;
@@ -331,7 +331,7 @@ - (void)testPast1
- (void)testPast2
{
- NSDate *date = [NSDate createDate:2111 month:8 day:31 hour:13 minute:12 second:0];
+ NSDate *date = [NSDate dateWithYear:2111 month:8 day:31 hour:13 minute:12 second:0];
BOOL result = [date past];
BOOL expected = FALSE;

0 comments on commit cee857d

Please sign in to comment.
Something went wrong with that request. Please try again.