-(void)fetcheArrayWithDate:(NSDate *)date{
NSDate *firstDayOfCurrentWeek = [DateCalculater firstWeekDayOftheDay:date];
NSDate *beginDate = [DateCalculater dateAfterWeeks:0 toDate:firstDayOfCurrentWeek];
NSMutableArray *weekDatesArray = [NSMutableArray array];
NSMutableArray *weekDaysArray = [NSMutableArray array];
for (NSInteger i = 0; i < 7; i++)
{
NSDate *newDate = [DateCalculater dateAfterDays:i toDate:beginDate ];
NSString *dateString = [DateCalculater stringFromDate:newDate];
[weekDatesArray addObject:dateString];//日期格式2016-11-14
NSInteger dateNumber = [DateCalculater dayNumberOftheDate:newDate];
NSString *dayString = [NSString stringWithFormat:@"%ld",dateNumber];
[weekDaysArray addObject:dayString];//14
}
NSInteger weekNumber = [DateCalculater weekNumberOftheDate:beginDate];//例如今天是47周
}
网友评论