ObjFW  Check-in [38dda0d1c7]

Overview
Comment:Allow passing nil to -[earlierDate/laterDate:].

If the argument is nil, it will return the receiver.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 38dda0d1c788db183a4b964ad0a7a08afe8faf259ddb4855573021a06ad24644
User & Date: js on 2012-11-23 23:57:35
Other Links: manifest | tags
Context
2012-11-24
00:07
-[OFSortedList addObject:] -> -[insertObject:]. check-in: 7a8a5a2995 user: js tags: trunk
2012-11-23
23:57
Allow passing nil to -[earlierDate/laterDate:]. check-in: 38dda0d1c7 user: js tags: trunk
2012-11-20
20:40
OFBlock: Make use of objc_initializeClassPair(). check-in: 2bedfac177 user: js tags: trunk
Changes

Modified src/OFDate.h from [2d8613f05a] to [a41dd96043].

285
286
287
288
289
290
291


292
293
294
295
296
297
298


299
300
301
302
303
304
305
 * @return A new, autoreleased OFString
 */
- (OFString*)localDateStringWithFormat: (OFConstantString*)format;

/*!
 * @brief Returns the earlier of the two dates.
 *


 * @param otherDate Another date
 * @return The earlier date of the two dates
 */
- (OFDate*)earlierDate: (OFDate*)otherDate;

/*!
 * @brief Returns the later of the two dates.


 *
 * @param otherDate Another date
 * @return The later date of the two dates
 */
- (OFDate*)laterDate: (OFDate*)otherDate;

/*!







>
>







>
>







285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
 * @return A new, autoreleased OFString
 */
- (OFString*)localDateStringWithFormat: (OFConstantString*)format;

/*!
 * @brief Returns the earlier of the two dates.
 *
 * If the argument is nil, it returns the receiver.
 *
 * @param otherDate Another date
 * @return The earlier date of the two dates
 */
- (OFDate*)earlierDate: (OFDate*)otherDate;

/*!
 * @brief Returns the later of the two dates.
 *
 * If the argument is nil, it returns the receiver.
 *
 * @param otherDate Another date
 * @return The later date of the two dates
 */
- (OFDate*)laterDate: (OFDate*)otherDate;

/*!

Modified src/OFDate.m from [da5cc3c73a] to [6b0927552c].

603
604
605
606
607
608
609



610
611
612
613
614
615
616
617



618
619
620
621
622
623
624
	}

	return ret;
}

- (OFDate*)earlierDate: (OFDate*)otherDate
{



	if ([self compare: otherDate] == OF_ORDERED_DESCENDING)
		return [[otherDate retain] autorelease];

	return [[self retain] autorelease];
}

- (OFDate*)laterDate: (OFDate*)otherDate
{



	if ([self compare: otherDate] == OF_ORDERED_ASCENDING)
		return [[otherDate retain] autorelease];

	return [[self retain] autorelease];
}

- (double)timeIntervalSince1970







>
>
>








>
>
>







603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
	}

	return ret;
}

- (OFDate*)earlierDate: (OFDate*)otherDate
{
	if (otherDate == nil)
		return [[self retain] autorelease];

	if ([self compare: otherDate] == OF_ORDERED_DESCENDING)
		return [[otherDate retain] autorelease];

	return [[self retain] autorelease];
}

- (OFDate*)laterDate: (OFDate*)otherDate
{
	if (otherDate == nil)
		return [[self retain] autorelease];

	if ([self compare: otherDate] == OF_ORDERED_ASCENDING)
		return [[otherDate retain] autorelease];

	return [[self retain] autorelease];
}

- (double)timeIntervalSince1970