title: How to make an NSCalendar week begin on Monday instead of Sunday
body: <p>When i try to make so that the current weeks date show up in the log (Monday to Sunday) it's like a week starts with a Sunday.
  For example:
  This week is wee 38.
  Yesterday it was 20th of September. My code did show the days from Monday to Sunday correct.
  But today (21th of September) my log shows next weeks dates (week 39) when it's still week 38.</p>
  
  <p>My code:</p>
  
  <pre><code>NSDate *currentDate = [NSDate date];
  NSCalendar *myCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  
  NSDateComponents *currentComps = [myCalendar components:( NSYearCalendarUnit | NSMonthCalendarUnit | NSWeekOfYearCalendarUnit | NSWeekdayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit) fromDate:currentDate];
  int thisWeeksNumber = currentComps.weekOfYear;
  NSLog(@"1  %d", thisWeeksNumber);
  
  [currentComps setWeekday:2];
  
  NSDate *firstDayOfTheWeek = [myCalendar dateFromComponents:currentComps];
  NSDate *secondDayOfTheWeek = [self dateByAddingDays:1 toDate:firstDayOfTheWeek];
  NSDate *thirdDayOfTheWeek = [self dateByAddingDays:2 toDate:firstDayOfTheWeek];
  NSDate *fourthDayOfTheWeek = [self dateByAddingDays:3 toDate:firstDayOfTheWeek];
  NSDate *fifthDayOfTheWeek = [self dateByAddingDays:4 toDate:firstDayOfTheWeek];
  NSDate *sixthDayOfTheWeek = [self dateByAddingDays:5 toDate:firstDayOfTheWeek];
  NSDate *seventhDayOfTheWeek = [self dateByAddingDays:6 toDate:firstDayOfTheWeek];
  
  NSDateFormatter *myDateFormatter = [[NSDateFormatter alloc] init];
  myDateFormatter.dateFormat = @"yyyy-MM-dd";
  NSString *firstStr = [myDateFormatter stringFromDate:firstDayOfTheWeek];
  NSString *secondStr = [myDateFormatter stringFromDate:secondDayOfTheWeek];
  NSString *thirdStr = [myDateFormatter stringFromDate:thirdDayOfTheWeek];
  NSString *fourthStr = [myDateFormatter stringFromDate:fourthDayOfTheWeek];
  NSString *fifthStr = [myDateFormatter stringFromDate:fifthDayOfTheWeek];
  NSString *sixthStr = [myDateFormatter stringFromDate:sixthDayOfTheWeek];
  NSString *seventhStr = [myDateFormatter stringFromDate:seventhDayOfTheWeek];
  
  NSLog(@"\n %@ \n %@ \n %@ \n %@ \n %@ \n %@ \n %@", firstStr, secondStr, thirdStr, fourthStr, fifthStr, sixthStr, seventhStr);   
  }
  </code></pre>
  
  <p>And my NSDate Method:</p>
  
  <pre><code>- (NSDate*)dateByAddingDays:(NSInteger)days toDate:(NSDate *)date
  {
  NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  NSDateComponents *comps = [[NSDateComponents alloc] init];
  comps.day = days;
  
  return [calendar dateByAddingComponents: comps toDate: date options: 0];
  }
  </code></pre>
  
  <p>This should display week 38 all days but it display next week dates because it's sunday. 
  (as i'm writing this it's week 38 and is 21th of September)</p>