 
   func configurePages(selectedDate: NSDate = NSDate()) {
     for i in -1...1 {
-      let daySelector = DaySelector()
+      let daySelector = DaySelector(daysInWeek: daysInWeek)
       let date = selectedDate.dateByAddingWeeks(i)
 
       daySelector.startDate = beginningOfWeek(date)

    centerDaySelector.selectedDate = selectedDate
  }

  func selectDate(selectedDate: NSDate) {
    let centerDaySelector = pagingScrollView.reusableViews[1] as! DaySelector
    let startDate = centerDaySelector.startDate.dateOnly()

    let currentWeek = DTTimePeriod(size: .Week, startingAt: startDate)

    if currentWeek.containsDate(selectedDate, interval: .Open) {
      centerDaySelector.selectedDate = selectedDate//.daysFrom(startDate)
    } else if selectedDate.isEarlierThan(currentWeek.StartDate) {
      currentWeekdayIndex = 6
      pagingScrollView.scrollBackward()

    } else if selectedDate.isLaterThan(currentWeek.EndDate) {
      currentWeekdayIndex = 0
      pagingScrollView.scrollForward()
    }
    swipeLabelView.date = selectedDate
  }

  override func layoutSubviews() {


  weak var delegate: DayHeaderViewDelegate?

  var daysInWeek = 7

  var calendar = NSCalendar.autoupdatingCurrentCalendar()

  var currentWeekdayIndex = -1
  var currentDate = NSDate().dateOnly()

  var daySymbolsViewHeight: CGFloat = 20
  var pagingScrollViewHeight: CGFloat = 40
  var swipeLabelViewHeight: CGFloat = 20

  lazy var daySymbolsView: DaySymbolsView = DaySymbolsView(daysInWeek: self.daysInWeek)
  let pagingScrollView = PagingScrollView()
  lazy var swipeLabelView: SwipeLabelView = SwipeLabelView(date: NSDate().dateOnly())

  init(selectedDate: NSDate) {
    self.currentDate = selectedDate
    super.init(frame: CGRect.zero)
    configure()
    configurePages(selectedDate)
