0

In my app i want to display expiration date its format is "M/yyyy" means 10/2014 using the help of default UIDatePicker Controller is it possible?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
bhavik
  • 1,673
  • 2
  • 14
  • 20

1 Answers1

0

You need to make your own custom class.As UIDatePicker not provide any api's to do that.You need to make custom picker and than fill with appropriate datasource.This code will help you and does same.

codester
  • 36,891
  • 10
  • 74
  • 72
  • How to hide previous year and month in this code like in UIDatePicker Controller to set minimum date and maximum date? – bhavik Jul 26 '14 at 12:57
  • @bhavik yes you can.You need to do in `pickerView: (UIPickerView *)pickerView viewForRow: (NSInteger)row forComponent:` method.Check the month and year if it is less than current date month and year disable it or do not show it as required – codester Jul 26 '14 at 13:05