DatePicker includes Year

I have a dataPicker in my application. But it shows only a month, a day, an hour. How can I add a year to the date picker. Any idea?

+7
source share
2 answers
datePicker.datePickerMode = UIDatePickerModeDate; 

UIDatePickerModeDate

Date selection shows months, days of the month, and years. The exact order of these elements depends on the locale setting. An example of this mode [November | 15 | 2007].

 Available in iOS 2.0 and later. Declared in UIDatePicker.h. 

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDatePicker_Class/Reference/UIDatePicker.html

You can also go from the storyboard mode: (see screenshot)

enter image description here

+7
source

If you want to add a month, date, year , and also , add one selector that uses dates only using (UIDatePickerModeDate) and extra for time (UIDatePickerModeTime).

+4
source

All Articles