We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 735bf06 commit 62403baCopy full SHA for 62403ba
Coding_iOS/Util/OC_Category/NSDate+Common.m
@@ -60,10 +60,12 @@ - (NSInteger)yearsAgo{
60
61
- (NSInteger)leftDayCount{
62
NSDate *today = [NSDate dateFromString:[[NSDate date] stringWithFormat:@"yyyy-MM-dd"] withFormat:@"yyyy-MM-dd"];//时分清零
63
+ NSDate *selfCopy = [NSDate dateFromString:[self stringWithFormat:@"yyyy-MM-dd"] withFormat:@"yyyy-MM-dd"];//时分清零
64
+
65
NSCalendar *calendar = [[self class] sharedCalendar];
66
NSDateComponents *components = [calendar components:(NSDayCalendarUnit)
67
fromDate:today
- toDate:self
68
+ toDate:selfCopy
69
options:0];
70
return [components day];
71
}
0 commit comments