title: Get day of week using NSDate
body: <p>I created a method that is supposed to take in a string in "YYYY-MM-DD" form and spit out an int that represents the dates position in relation to the week it is in (regardless if it overlaps between months). So e.g sunday=1 monday=2 and so on. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>    func getDayOfWeek(today:String)-&gt;Int{
  
      var formatter:NSDateFormatter = NSDateFormatter()
      formatter.dateFormat = "YYYY-MM-DD"
      var todayDate:NSDate = formatter.dateFromString(today)!
      var myCalendar:NSCalendar = NSCalendar(calendarIdentifier: NSGregorianCalendar)
      var myComponents = myCalendar.components(NSCalendarUnit.WeekdayOrdinalCalendarUnit, fromDate: todayDate)
      var weekDay = myComponents.weekdayOrdinal
      return weekDay
  }
  </code></pre>
  
  <p>I know that <code>NSCalendarUnit.WeekdayOrdinalCalendar</code> is wrong but I have tried I think most logical combinations. And have also messed around with <code>myComponents.weekdayOrdinal</code> e.g used <code>mycomponents.day</code> or <code>.weekday</code>.</p>
  
  <p>Here are my options in what to use:</p>
  
  <pre><code>static var EraCalendarUnit: NSCalendarUnit { get }
  static var YearCalendarUnit: NSCalendarUnit { get }
  static var MonthCalendarUnit: NSCalendarUnit { get }
  static var DayCalendarUnit: NSCalendarUnit { get }
  static var HourCalendarUnit: NSCalendarUnit { get }
  static var MinuteCalendarUnit: NSCalendarUnit { get }
  static var SecondCalendarUnit: NSCalendarUnit { get }
  static var WeekCalendarUnit: NSCalendarUnit { get }
  static var WeekdayCalendarUnit: NSCalendarUnit { get }
  static var WeekdayOrdinalCalendarUnit: NSCalendarUnit { get }
  static var QuarterCalendarUnit: NSCalendarUnit { get }
  static var WeekOfMonthCalendarUnit: NSCalendarUnit { get }
  static var WeekOfYearCalendarUnit: NSCalendarUnit { get }
  static var YearForWeekOfYearCalendarUnit: NSCalendarUnit { get }
  static var CalendarCalendarUnit: NSCalendarUnit { get }
  static var TimeZoneCalendarUnit: NSCalendarUnit { get }
  </code></pre>
  
  <p>It is not clear to me since there is no DayOfWeekUnit option (or something similar).</p>