     
     @IBAction func onDoneDatePopup(sender: UIButton) {
         
-
         let formatter1 = DateFormatter.MM_dd_yyyy
         let fromDate = formatter1.dateFromString((fromButton.titleLabel!.text)!)
         let toDate = formatter1.dateFromString((toButton.titleLabel!.text)!)

            default:
                return
            }
            viewModeTableView.reloadData()
            closePopup(viewModePopup)
        }
    }

        let calendar = NSCalendar.currentCalendar()
        
        // Create an NSDate for the first and last day of the month
        let components = calendar.components([NSCalendarUnit.Month, NSCalendarUnit.Year], fromDate: NSDate())
        
        // Get suitable month
        components.month += monthIndex
