                 
                 let formatter = NSDateFormatter()
                 formatter.dateFormat = dateFormat
-                if let date = formatter.dateFromString(string) {
+                if let date = formatter.dateFromString(string as String) {
                     self.init(timeInterval:0, sinceDate:date)
                 } else {
                     self.init()

    
    func dateAtEndOfWeek() -> NSDate
    {
        let flags :NSCalendarUnit = .YearCalendarUnit | .MonthCalendarUnit | .WeekCalendarUnit | .WeekdayCalendarUnit
        var components = NSCalendar.currentCalendar().components(flags, fromDate: self)
        components.weekday = 7 // Sunday
        components.hour = 0

//
//  Created by Melvin Rivera on 7/15/14.
//  Copyright (c) 2014. All rights reserved.
//  Updated to Swift 1.2 by Marin Todorov

import Foundation

