- Add - (NSDate *) dateAtEndOfDay;
This commit is contained in:
parent
5e98f9f510
commit
05364772e4
@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "NSDate_Utils"
|
||||
s.version = "0.1.1"
|
||||
s.version = "0.1.2"
|
||||
s.summary = "NSDate_Utils is a NSDate category that helps date managements. For example NSString to NSDate, NSDate to NSString,NSSdate comparisons"
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
|
||||
@ -63,6 +63,7 @@ static NSString *kNSDateHelperFormatSQLDateWithTimeEN_shashSeparated = @"
|
||||
- (NSDate *) dateBySubtractingYears:(NSInteger) years;
|
||||
|
||||
- (NSDate *) dateAtStartOfDay;
|
||||
- (NSDate *) dateAtEndOfDay;
|
||||
|
||||
- (NSInteger) minutesAfterDate:(NSDate *) aDate;
|
||||
- (CGFloat) distanceInWeeksToDate:(NSDate *) anotherDate;
|
||||
|
||||
@ -46,6 +46,16 @@ static NSDateFormatter *_displayFormatter = nil;
|
||||
components.second = 0;
|
||||
return [CURRENT_CALENDAR dateFromComponents:components];
|
||||
}
|
||||
|
||||
- (NSDate *) dateAtEndOfDay
|
||||
{
|
||||
NSDateComponents *components = [CURRENT_CALENDAR components:DATE_COMPONENTS fromDate:self];
|
||||
components.hour = 23;
|
||||
components.minute = 59;
|
||||
components.second = 59;
|
||||
return [CURRENT_CALENDAR dateFromComponents:components];
|
||||
}
|
||||
|
||||
- (NSInteger) minutesAfterDate: (NSDate *) aDate
|
||||
{
|
||||
NSTimeInterval ti = [self timeIntervalSinceDate:aDate];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user