title: Calculating the date of the first day of the week for a date in the first week of the year changes the month
body: <p>I need to get date for the first day of the week from any date.
  This code works fine, but for some dates I get a very strange result. A date from the first week of the year converts to last week's date:</p>
  
  <pre><code>NSTimeInterval ti = 1420311299;
  NSDate* date = [NSDate dateWithTimeIntervalSince1970:ti];
  
  NSLog(@"%@", date); // OUTPUT: 2015-01-03 18:54:59 +0000
  
  NSCalendar* calendar = [NSCalendar currentCalendar];
  NSDateComponents *cmps = [calendar components:(kCFCalendarUnitWeekOfYear | kCFCalendarUnitYear) fromDate:date];
  
  cmps.weekday = calendar.firstWeekday;
  
  NSLog(@"%@", cmps); // OUTPUT:  Calendar Year: 2015
                      //          Week of Year: 1
                      //          Weekday: 1
  
  
  
  NSDate* newDate = [calendar dateFromComponents:cmps];
  
  NSLog(@"%@", newDate); // OUTPUT: 2015-12-26 22:00:00 +0000
  </code></pre>