         self.month = month
         self.year = year
     }
+    
+    override public var description : String {
+        
+        return "Day : \(self.day)\nMonth : \(self.month)\nYear : \(self.year)"
+    }
+    
 }
 
+protocol VJDatePickerDelegate {
+    
+    func dateComponentsDidChange(dateComponents : VJDateComponents)
+    
+}
+
+
 class VJDatePicker: UIPickerView, UIPickerViewDataSource, UIPickerViewDelegate {
+    
+    var datePickerDelegate : VJDatePickerDelegate?
+    
+    private let month_31 = [1, 3, 5, 7, 8, 10, 12]
     
     var initialComponents : VJDateComponents!
     
     var minimumYearValue : Int!
     var maximumYearValue : Int!
     
-    private var selectedComponents : VJDateComponents{
-        return self.selectedComponents
-    }
-    
-    var datePickerType: VJDatePickerType! = .Default
+    private var _selectedComponents = VJDateComponents()
+    
+    var selectedComponents : VJDateComponents{
+        return _selectedComponents
+    }
+    
+    var datePickerType: VJDatePickerType! = .MonthDay{
+        didSet{
+            self.alpha = 0.0
+            UIView.animateWithDuration(0.5, animations: { () -> Void in
+                self.alpha = 1.0
+                self.commonInit()
+                }, completion: nil)
+        }
+    }
     
     private var maxElements = Int(INT16_MAX)
     

    // The default initializer sets components from
    // current system date
    
    init(){
        let calendar = NSCalendar.currentCalendar()
        let todayComponents = calendar.components([.Day,.Month,.Year], fromDate: NSDate())
        self.day = todayComponents.day

        let selectedMonth = half + (months.count - (half % months.count)) + initialComponents.month!
        let selectedDate = half + (days.count - (half % days.count)) + initialComponents.day!
        let selectedYear = years.indexOf(initialComponents.year!)
        
        switch type!{
            
        case .Default:
            selectRow(selectedDate - 1, inComponent: 1, animated: false)
            selectRow(selectedMonth - 1, inComponent: 0, animated: false)
            selectRow(selectedYear!, inComponent: 2, animated: false)
        case .MonthDay:
            selectRow(selectedDate - 1, inComponent: 1, animated: false)
            selectRow(selectedMonth - 1, inComponent: 0, animated: false)
            break
        case .MonthOnly:
            selectRow(selectedMonth - 1, inComponent: 0, animated: false)
            break
        case .DayOnly:
            selectRow(selectedDate - 1, inComponent: 0, animated: false)
            break
        case .YearMonth:
            selectRow(selectedMonth - 1, inComponent: 1, animated: false)
            selectRow(selectedYear!, inComponent: 0, animated: false)
            break
        case .YearOnly:
            selectRow(selectedYear!, inComponent: 0, animated: false)
            break
        }
    }
    
    private func getNumberOfComponentsForDatePickerType(var type : VJDatePickerType?)->Int{
