how can I calculate the calendar week? A year has 52/53 weeks and there are two rules:
-DIN 1355 / ISO 8601
I'd like to work with DIN 1355 / ISO 8601. How can I manage that?
NSDate *today = [NSDate date];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
NSString *weeknumber = [dateFormat stringFromDate: today];
NSLog(@"week: %@", weeknumber);
NSCalendar *cal = [NSCalendar currentCalendar]; NSDateComponents *components = [cal components:NSWeekCalendarUnit fromDate:date]; NSInteger week = [components week];